Packet (ActiveIO 1.0 API)
Keywords: org.activeio.Packet interface

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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$

Nested Class Summary
`static class` | `Packet.ByteSequence`

Method Summary
`Packet.ByteSequence` | `asByteSequence()`
`int` | `capacity()`
`void` | `clear()`
`Packet` | `duplicate()`
`java.lang.Object` | `duplicate(java.lang.ClassLoader cl)`
`void` | `flip()`
`boolean` | `hasRemaining()`
`int` | `limit()`
`void` | `limit(int limit)`
`java.lang.Object` | `narrow(java.lang.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(java.io.DataOutput out)`
`void` | `writeTo(java.io.OutputStream out)` Writes the remaing bytes in the packet to the output stream.

Methods inherited from interface org.activeio.Disposable
`dispose`

Method Detail

### 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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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