def _write_3(fid, val):
 f_bytes = np.zeros(3, dtype=np.uint8)
 f_bytes[0] = ((val >> 16) & 255)
 f_bytes[1] = ((val >> 8) & 255)
 f_bytes[2] = (val & 255)
 fid.write(f_bytes.tostring())

def _write_3 ( fid , val ) : f_bytes = np . zeros ( 3 , dtype = np . uint8 ) f_bytes [ 0 ] = ( ( val >> 16 ) & 255 ) f_bytes [ 1 ] = ( ( val >> 8 ) & 255 ) f_bytes [ 2 ] = ( val & 255 ) fid . write ( f_bytes . tostring ( ) )
write 3 byte integer to file .