Package org.apache.activeio.packet
Class FilterPacket
- java.lang.Object
-
- org.apache.activeio.packet.FilterPacket
-
- All Implemented Interfaces:
Packet
- Direct Known Subclasses:
PacketPool.PooledPacket
public abstract class FilterPacket extends java.lang.Object implements Packet
Provides a Packet implementation that filters operations to another packet. Used to make it easier to augment the {@see #narrow(Class)}method.- Version:
- $Revision$
-
-
Constructor Summary
Constructors Constructor Description FilterPacket(Packet next)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ByteSequence
asByteSequence()
int
capacity()
void
clear()
void
dispose()
Packet
duplicate()
java.lang.Object
duplicate(java.lang.ClassLoader cl)
abstract Packet
filter(Packet packet)
void
flip()
java.lang.Object
getAdapter(java.lang.Class target)
boolean
hasRemaining()
int
limit()
void
limit(int limit)
int
position()
void
position(int position)
int
read()
int
read(byte[] data, int offset, int length)
int
read(Packet dest)
int
remaining()
void
rewind()
Packet
slice()
byte[]
sliceAsBytes()
int
write(byte[] data, int offset, int length)
boolean
write(int data)
void
writeTo(java.io.DataOutput out)
void
writeTo(java.io.OutputStream out)
Writes the remaing bytes in the packet to the output stream.
-
-
-
Field Detail
-
next
protected final Packet next
-
-
Constructor Detail
-
FilterPacket
public FilterPacket(Packet next)
-
-
Method Detail
-
asByteSequence
public ByteSequence asByteSequence()
- Specified by:
asByteSequence
in interfacePacket
-
hasRemaining
public boolean hasRemaining()
- Specified by:
hasRemaining
in interfacePacket
-
getAdapter
public java.lang.Object getAdapter(java.lang.Class target)
- Specified by:
getAdapter
in interfacePacket
-
sliceAsBytes
public byte[] sliceAsBytes()
- Specified by:
sliceAsBytes
in interfacePacket
-
write
public int write(byte[] data, int offset, int length)
-
writeTo
public void writeTo(java.io.OutputStream out) throws java.io.IOException
Description copied from interface:Packet
Writes the remaing bytes in the packet to the output stream.
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOException
-
duplicate
public java.lang.Object duplicate(java.lang.ClassLoader cl) throws java.io.IOException
-
-