org.apache.activeio.packet
Interface Packet

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

public interface Packet

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

Version:
$Revision$

Method Summary
 ByteSequence asByteSequence()
           
 int capacity()
           
 void clear()
           
 void dispose()
           
 Packet duplicate()
           
 java.lang.Object duplicate(java.lang.ClassLoader cl)
           
 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.
 

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

java.lang.Object duplicate(java.lang.ClassLoader cl)
                           throws java.io.IOException
Throws:
java.io.IOException

capacity

int capacity()

dispose

void dispose()

asByteSequence

ByteSequence asByteSequence()

sliceAsBytes

byte[] sliceAsBytes()

getAdapter

java.lang.Object getAdapter(java.lang.Class target)

writeTo

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

Parameters:
out -
Throws:
java.io.IOException

writeTo

void writeTo(java.io.DataOutput out)
             throws java.io.IOException
Throws:
java.io.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)


Copyright © 2005-2011. All Rights Reserved.