MemoryBuffer function ( MemoryLayout arg0 , byte [ ] arg1 , DataType [ ] arg2 ) { ByteBuffer loc0 = ByteBuffer . wrap ( arg1 ) ; loc0 . order ( arg0 . order ) ; return new MemoryBuffer ( arg0 , loc0 , arg2 ) ; }
wraps a byte array into a structured memorybuffer with given memorylayout . note that modifications to the buffer are applied to the backed array and vice versa . a structured memorybuffer can be used to simplify reading c struct data from the memory as it provides support for data aligning . the structure array elements should be set to exactly the same types and order that the corresponding c struct has . concode_field_sep int structIndex concode_elem_sep MemoryLayout memLayout concode_elem_sep DataType[] structure concode_elem_sep ByteBuffer bbuf concode_field_sep int getInt32 concode_elem_sep MemoryBuffer putInt16 concode_elem_sep MemoryBuffer putAddr concode_elem_sep byte getByte concode_elem_sep short getShort concode_elem_sep MemoryBuffer putInt concode_elem_sep short getInt16 concode_elem_sep MemoryBuffer putLong concode_elem_sep byte[] getBytes concode_elem_sep long getInt64 concode_elem_sep long getLong concode_elem_sep int getInt concode_elem_sep MemoryBuffer putByte concode_elem_sep DataType getType concode_elem_sep MemoryBuffer putInt32 concode_elem_sep void skipPaddingBytesFor concode_elem_sep MemoryBuffer putInt64 concode_elem_sep long getAddr concode_elem_sep MemoryBuffer putShort concode_elem_sep MemoryBuffer putInt8 concode_elem_sep byte getInt8