public final class ByteBufferPacket extends Object implements Packet
ByteBuffer
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE |
static int |
DEFAULT_DIRECT_BUFFER_SIZE |
Constructor and Description |
---|
ByteBufferPacket(ByteBuffer buffer) |
Modifier and Type | Method and Description |
---|---|
ByteSequence |
asByteSequence() |
int |
capacity() |
void |
clear() |
Packet |
compact() |
static ByteBufferPacket |
createDefaultBuffer(boolean direct) |
void |
dispose() |
Packet |
duplicate() |
Object |
duplicate(ClassLoader cl) |
void |
flip() |
Object |
getAdapter(Class target) |
ByteBuffer |
getByteBuffer() |
boolean |
hasRemaining() |
boolean |
isDirect() |
boolean |
isReadOnly() |
int |
limit() |
void |
limit(int arg0) |
Packet |
mark() |
int |
position() |
void |
position(int arg0) |
int |
read() |
int |
read(byte[] data,
int offset,
int length) |
int |
read(Packet dest) |
int |
remaining() |
void |
rewind() |
Packet |
slice() |
byte[] |
sliceAsBytes() |
String |
toString() |
int |
write(byte[] data,
int offset,
int length) |
boolean |
write(int data) |
void |
writeTo(DataOutput out) |
void |
writeTo(OutputStream out)
Writes the remaing bytes in the packet to the output stream.
|
public static final int DEFAULT_BUFFER_SIZE
public static final int DEFAULT_DIRECT_BUFFER_SIZE
public ByteBufferPacket(ByteBuffer buffer)
public ByteBuffer getByteBuffer()
public static ByteBufferPacket createDefaultBuffer(boolean direct)
public void writeTo(OutputStream out) throws IOException
Packet
writeTo
in interface Packet
IOException
public void writeTo(DataOutput out) throws IOException
writeTo
in interface Packet
IOException
public Packet compact()
public boolean hasRemaining()
hasRemaining
in interface Packet
public boolean isDirect()
public boolean isReadOnly()
public Packet mark()
public Object duplicate(ClassLoader cl) throws IOException
duplicate
in interface Packet
IOException
public int read()
read
in interface Packet
Packet.read()
public int read(byte[] data, int offset, int length)
read
in interface Packet
Packet.read(byte[], int, int)
public boolean write(int data)
write
in interface Packet
Packet.write(int)
public int write(byte[] data, int offset, int length)
write
in interface Packet
Packet.write(byte[], int, int)
public ByteSequence asByteSequence()
asByteSequence
in interface Packet
Packet.asByteSequence()
public byte[] sliceAsBytes()
sliceAsBytes
in interface Packet
Packet.sliceAsBytes()
public int read(Packet dest)
public Object getAdapter(Class target)
getAdapter
in interface Packet
Copyright © 2005–2015 The Apache Software Foundation. All rights reserved.