Modified byte converting of data in write method of seriaposix.py