org.activeio
Interface Packet

All Superinterfaces:
Disposable
All Known Implementing Classes:
AppendedPacket, ByteArrayPacket, ByteBufferPacket, BytePacket, EmptyPacket, EOSPacket, FilterPacket, PacketPool.PooledPacket

public interface Packet
extends Disposable

Provides a ByteBuffer like interface to work with IO channel packets of data.

Version:
$Revision$

Nested Class Summary
static class Packet.ByteSequence
           
 
Method Summary
 Packet.ByteSequence asByteSequence()
           
 int capacity()
           
 void clear()
           
 Packet duplicate()
           
 Object duplicate(ClassLoader cl)
           
 void flip()
           
 boolean hasRemaining()
           
 int limit()
           
 void limit(int limit)
           
 Object narrow(Class target)
          Used to get a richer metadata interface to the packet.
 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(DataOutput out)
           
 void writeTo(OutputStream out)
          Writes the remaing bytes in the packet to the output stream.
 
Methods inherited from interface org.activeio.Disposable
dispose
 

Method Detail

position

int position()

position

void position(int position)

limit

int limit()

limit

void limit(int limit)

flip

void flip()

remaining

int remaining()

rewind

void rewind()

hasRemaining

boolean hasRemaining()

clear

void clear()

slice

Packet slice()

duplicate

Packet duplicate()

duplicate

Object duplicate(ClassLoader cl)
                 throws IOException
Throws:
IOException

capacity

int capacity()

asByteSequence

Packet.ByteSequence asByteSequence()

sliceAsBytes

byte[] sliceAsBytes()

writeTo

void writeTo(OutputStream out)
             throws IOException
Writes the remaing bytes in the packet to the output stream.

Parameters:
out -
Throws:
IOException

writeTo

void writeTo(DataOutput out)
             throws IOException
Throws:
IOException

read

int read()

read

int read(byte[] data,
         int offset,
         int length)

write

boolean write(int data)

write

int write(byte[] data,
          int offset,
          int length)

read

int read(Packet dest)

narrow

Object narrow(Class target)
Used to get a richer metadata interface to the packet.



Copyright © -2009 The ActiveIO Project. All Rights Reserved.