mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2026-01-23 08:16:04 +00:00
Adding wrap.
This commit is contained in:
@@ -37,8 +37,11 @@ public class DataBuffer {
|
||||
private ByteBuffer buffer;
|
||||
|
||||
public static DataBuffer wrap(byte[] data) {
|
||||
return wrap(data, 0, data.length);
|
||||
}
|
||||
public static DataBuffer wrap(byte[] data, int offset, int length) {
|
||||
DataBuffer dbuf = new DataBuffer();
|
||||
dbuf.buffer = ByteBuffer.wrap(data);
|
||||
dbuf.buffer = ByteBuffer.wrap(data, offset, length);
|
||||
dbuf.buffer.order(ByteOrder.LITTLE_ENDIAN);
|
||||
return dbuf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user