FilterPacket (ActiveIO 1.0 API)
Keywords: org.activeio.packet.FilterPacket class

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.packet
Class FilterPacket

    java.lang.Object
      org.activeio.packet.FilterPacket

All Implemented Interfaces:
  Disposable, Packet

Direct Known Subclasses:
  PacketPool.PooledPacket

public abstract class FilterPacket
extends java.lang.Object
implements Packet

Provides a Packet implementation that filters operations to another packet. Used to make it easier to augment the `narrow(Class)`method.

Version:
  $Revision$

Nested Class Summary

Nested classes inherited from class org.activeio.Packet
`Packet.ByteSequence`

Field Summary
`protected Packet` | `next`

Constructor Summary
`FilterPacket(Packet next)`

Method Summary
`Packet.ByteSequence` | `asByteSequence()`
`int` | `capacity()`
`void` | `clear()`
`void` | `dispose()` This method should not throw any exceptions.
`Packet` | `duplicate()`
`java.lang.Object` | `duplicate(java.lang.ClassLoader cl)`
`abstract Packet` | `filter(Packet packet)`
`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 class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### next

    protected final Packet next

Constructor Detail

### FilterPacket

    public FilterPacket(Packet next)

Method Detail

### asByteSequence

    public Packet.ByteSequence asByteSequence()

  Specified by:
    `asByteSequence` in interface `Packet`

### capacity

    public int capacity()

  Specified by:
    `capacity` in interface `Packet`

### clear

    public void clear()

  Specified by:
    `clear` in interface `Packet`

### flip

    public void flip()

  Specified by:
    `flip` in interface `Packet`

### hasRemaining

    public boolean hasRemaining()

  Specified by:
    `hasRemaining` in interface `Packet`

### limit

    public int limit()

  Specified by:
    `limit` in interface `Packet`

### limit

    public void limit(int limit)

  Specified by:
    `limit` in interface `Packet`

### narrow

    public java.lang.Object narrow(java.lang.Class target)

  Description copied from interface: `Packet`
  Used to get a richer metadata interface to the packet.

  Specified by:
    `narrow` in interface `Packet`

### position

    public int position()

  Specified by:
    `position` in interface `Packet`

### position

    public void position(int position)

  Specified by:
    `position` in interface `Packet`

### read

    public int read()

  Specified by:
    `read` in interface `Packet`

### read

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

  Specified by:
    `read` in interface `Packet`

### read

    public int read(Packet dest)

  Specified by:
    `read` in interface `Packet`

### remaining

    public int remaining()

  Specified by:
    `remaining` in interface `Packet`

### rewind

    public void rewind()

  Specified by:
    `rewind` in interface `Packet`

### sliceAsBytes

    public byte[] sliceAsBytes()

  Specified by:
    `sliceAsBytes` in interface `Packet`

### write

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

  Specified by:
    `write` in interface `Packet`

### write

    public boolean write(int data)

  Specified by:
    `write` 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`
  Parameters:
    `out` -
  Returns:
  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`

### duplicate

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

  Specified by:
    `duplicate` in interface `Packet`
  Throws:
    `java.io.IOException`

### duplicate

    public Packet duplicate()

  Specified by:
    `duplicate` in interface `Packet`

### slice

    public Packet slice()

  Specified by:
    `slice` in interface `Packet`

### dispose

    public void dispose()

  Description copied from interface: `Disposable`
  This method should not throw any exceptions. Cleaning up a Disposable object should be easy of an end user therefore do not make him have to handle an Exception.

  Specified by:
    `dispose` in interface `Disposable`

### filter

    public abstract Packet filter(Packet 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.