#NEWLINE# def write_to_buffer( buffer , data , offset = 0 ) : #NEWLINE# #INDENT# if isinstance ( buffer , ctypes . POINTER ( ctypes . c_byte ) ) : #NEWLINE# #INDENT# ctypes . memmove ( buffer , data , len ( data ) ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( offset == 0 ) : #NEWLINE# #INDENT# buffer . value = data #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# buffer . value = ( buffer . raw [ 0 : offset ] + data )