@with_open_mode('wb+')
@with_sizes('medium')
def read_modify_bytewise(f, source):
 f.seek(0)
 for i in xrange(0, len(source), 2):
  f.read(1)
  f.write(source[(i + 1):(i + 2)])

@ with_open_mode ( 'wb+' ) @ with_sizes ( 'medium' ) def read_modify_bytewise ( f , source ) : f . seek ( 0 ) for i in xrange ( 0 , len ( source ) , 2 ) : f . read ( 1 ) f . write ( source [ ( i + 1 ) : ( i + 2 ) ] )
alternate read & write one unit .