Package org.apache.activeio.packet
Class EmptyPacket
java.lang.Object
org.apache.activeio.packet.EmptyPacket
- All Implemented Interfaces:
Packet
Provides a Packet implementation that is directly backed by a
byte[0]
.- Version:
- $Revision$
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionint
capacity()
void
clear()
void
dispose()
duplicate
(ClassLoader cl) void
flip()
getAdapter
(Class target) boolean
int
limit()
void
limit
(int limit) int
position()
void
position
(int position) int
read()
int
read
(byte[] data, int offset, int length) int
int
void
rewind()
slice()
byte[]
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.
-
Field Details
-
EMPTY_PACKET
-
-
Method Details
-
writeTo
Description copied from interface:Packet
Writes the remaing bytes in the packet to the output stream.- Specified by:
writeTo
in interfacePacket
- Throws:
IOException
-
writeTo
- Specified by:
writeTo
in interfacePacket
- Throws:
IOException
-
position
public int position() -
position
public void position(int position) -
limit
public int limit() -
limit
public void limit(int limit) -
flip
public void flip() -
remaining
public int remaining() -
rewind
public void rewind() -
hasRemaining
public boolean hasRemaining()- Specified by:
hasRemaining
in interfacePacket
-
clear
public void clear() -
capacity
public int capacity() -
slice
-
duplicate
-
duplicate
- Specified by:
duplicate
in interfacePacket
- Throws:
IOException
-
read
public int read() -
read
public int read(byte[] data, int offset, int length) -
write
public boolean write(int data) -
write
public int write(byte[] data, int offset, int length) -
asByteSequence
- Specified by:
asByteSequence
in interfacePacket
-
sliceAsBytes
public byte[] sliceAsBytes()- Specified by:
sliceAsBytes
in interfacePacket
-
read
-
toString
-
getAdapter
- Specified by:
getAdapter
in interfacePacket
-
dispose
public void dispose()
-