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 java.lang.Object duplicate(java.lang.ClassLoader cl)
throws java.io.IOException
- Throws:
java.io.IOException
capacity
public int capacity()
asByteSequence
public Packet.ByteSequence asByteSequence()
sliceAsBytes
public byte[] sliceAsBytes()
writeTo
public void writeTo(java.io.OutputStream out)
throws java.io.IOException
- Writes the remaing bytes in the packet to the output stream.
- Parameters:
out
-
- Returns:
-
- Throws:
java.io.IOException
writeTo
public void writeTo(java.io.DataOutput out)
throws java.io.IOException
- Throws:
java.io.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 java.lang.Object narrow(java.lang.Class target)
- Used to get a richer metadata interface to the packet.
Copyright © -2005 The ActiveIO Project. All Rights Reserved.