org.activeio
Interface Packet
- All Superinterfaces:
- Disposable
- All Known Implementing Classes:
- AppendedPacket, ByteArrayPacket, ByteBufferPacket, BytePacket, EmptyPacket, EOSPacket, FilterPacket
- public interface Packet
- extends Disposable
Provides a ByteBuffer like interface to work with IO channel packets of data.
- Version:
- $Revision$
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()
clear
public void clear()
slice
public Packet slice()
duplicate
public Packet duplicate()
duplicate
public Object duplicate(ClassLoader cl)
throws IOException
- Throws:
IOException
capacity
public int capacity()
asByteSequence
public Packet.ByteSequence asByteSequence()
sliceAsBytes
public byte[] sliceAsBytes()
writeTo
public void writeTo(OutputStream out)
throws IOException
- Writes the remaing bytes in the packet to the output stream.
- Parameters:
out
-
- Returns:
-
- Throws:
IOException
writeTo
public void writeTo(DataOutput out)
throws IOException
- 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)
read
public int read(Packet dest)
narrow
public Object narrow(Class target)
- Used to get a richer metadata interface to the packet.
Copyright © -2007 The ActiveIO Project. All Rights Reserved.