org.apache.activeio.packet
Class AppendedPacket

java.lang.Object
  extended by org.apache.activeio.packet.AppendedPacket
All Implemented Interfaces:
Packet

public final class AppendedPacket
extends java.lang.Object
implements Packet

Appends two packets together.

Version:
$Revision$

Constructor Summary
AppendedPacket(Packet first, Packet second)
          Deprecated. use join(Packet, Packet) instead.
 
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()
           
static Packet join(Packet first, Packet last)
           
 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()
           
 java.lang.String toString()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AppendedPacket

public AppendedPacket(Packet first,
                      Packet second)
Deprecated. use join(Packet, Packet) instead.

Method Detail

join

public static Packet join(Packet first,
                          Packet last)

position

public void position(int position)
Specified by:
position in interface Packet

limit

public void limit(int limit)
Specified by:
limit in interface Packet

slice

public Packet slice()
Specified by:
slice in interface Packet

duplicate

public Packet duplicate()
Specified by:
duplicate in interface Packet

duplicate

public java.lang.Object duplicate(java.lang.ClassLoader cl)
                           throws java.io.IOException
Specified by:
duplicate in interface Packet
Throws:
java.io.IOException

flip

public void flip()
Specified by:
flip in interface Packet

position

public int position()
Specified by:
position in interface Packet

limit

public int limit()
Specified by:
limit in interface Packet

remaining

public int remaining()
Specified by:
remaining in interface Packet

rewind

public void rewind()
Specified by:
rewind in interface Packet

hasRemaining

public boolean hasRemaining()
Specified by:
hasRemaining in interface Packet

clear

public void clear()
Specified by:
clear in interface Packet

capacity

public int capacity()
Specified by:
capacity in interface Packet

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.

Specified by:
writeTo in interface Packet
Throws:
java.io.IOException

writeTo

public void writeTo(java.io.DataOutput out)
             throws java.io.IOException
Specified by:
writeTo in interface Packet
Throws:
java.io.IOException

read

public int read()
Specified by:
read in interface Packet
See Also:
Packet.read()

read

public int read(byte[] data,
                int offset,
                int length)
Specified by:
read in interface Packet
See Also:
Packet.read(byte[], int, int)

write

public boolean write(int data)
Specified by:
write in interface Packet
See Also:
Packet.write(int)

write

public int write(byte[] data,
                 int offset,
                 int length)
Specified by:
write in interface Packet
See Also:
Packet.write(byte[], int, int)

read

public int read(Packet dest)
Specified by:
read in interface Packet

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAdapter

public java.lang.Object getAdapter(java.lang.Class target)
Specified by:
getAdapter in interface Packet

asByteSequence

public ByteSequence asByteSequence()
Specified by:
asByteSequence in interface Packet

sliceAsBytes

public byte[] sliceAsBytes()
Specified by:
sliceAsBytes in interface Packet

dispose

public void dispose()
Specified by:
dispose in interface Packet


Copyright © 2005-2011. All Rights Reserved.