public final class ByteBuffer extends Object
Constructor and Description |
---|
ByteBuffer(byte[] buf) |
ByteBuffer(byte[] buf,
int offset,
int length)
Constructs the buffer.
|
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
get(byte[] b,
int offset,
int length)
Gets a byte array from the buffer.
|
byte |
getByte() |
int |
getInt() |
short |
getShort() |
int |
limit()
Returns the limit of this buffer.
|
int |
position()
Returns the current position.
|
void |
position(int position)
Sets the position in to the buffer.
|
ByteBuffer |
put(byte[] b) |
ByteBuffer |
put(byte[] b,
int offset,
int length)
Puts a byte array into the buffer.
|
ByteBuffer |
put(ByteBuffer buffer)
Puts a ByteBuffer in to this buffer.
|
ByteBuffer |
putByte(byte v)
Puts/Gets a byte into the buffer at the current position.
|
ByteBuffer |
putInt(int v)
Puts/Gets an integer into the buffer at the current position.
|
ByteBuffer |
putShort(short v)
Puts/Gets a short into the buffer at the current position.
|
public ByteBuffer(byte[] buf, int offset, int length)
public ByteBuffer(byte[] buf)
public void position(int position)
public int position()
public int limit()
public ByteBuffer put(byte[] b, int offset, int length)
public ByteBuffer put(byte[] b)
public ByteBuffer put(ByteBuffer buffer)
public ByteBuffer get(byte[] b, int offset, int length)
public ByteBuffer putInt(int v)
public int getInt()
public ByteBuffer putByte(byte v)
public byte getByte()
public ByteBuffer putShort(short v)
public short getShort()
Copyright © 2015. All rights reserved.