Package org.apache.activeio.packet
Class FilterPacket
java.lang.Object
org.apache.activeio.packet.FilterPacket
- All Implemented Interfaces:
Packet
- Direct Known Subclasses:
PacketPool.PooledPacket
Provides a Packet implementation that filters operations to another packet.
Used to make it easier to augment the method.
- Version:
- $Revision$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
capacity()
void
clear()
void
dispose()
duplicate
(ClassLoader cl) abstract Packet
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[]
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
-
next
-
-
Constructor Details
-
FilterPacket
-
-
Method Details
-
asByteSequence
- Specified by:
asByteSequence
in interfacePacket
-
capacity
public int capacity() -
clear
public void clear() -
flip
public void flip() -
hasRemaining
public boolean hasRemaining()- Specified by:
hasRemaining
in interfacePacket
-
limit
public int limit() -
limit
public void limit(int limit) -
getAdapter
- Specified by:
getAdapter
in interfacePacket
-
position
public int position() -
position
public void position(int position) -
read
public int read() -
read
public int read(byte[] data, int offset, int length) -
read
-
remaining
public int remaining() -
rewind
public void rewind() -
sliceAsBytes
public byte[] sliceAsBytes()- Specified by:
sliceAsBytes
in interfacePacket
-
write
public int write(byte[] data, int offset, int length) -
write
public boolean write(int data) -
writeTo
Description copied from interface:Packet
Writes the remaing bytes in the packet to the output stream.- Specified by:
writeTo
in interfacePacket
- Parameters:
out
-- Throws:
IOException
-
writeTo
- Specified by:
writeTo
in interfacePacket
- Throws:
IOException
-
duplicate
- Specified by:
duplicate
in interfacePacket
- Throws:
IOException
-
duplicate
-
slice
-
dispose
public void dispose() -
filter
-