## org.mortbay.io
Class BufferCache

    java.lang.Object
      org.mortbay.io.BufferCache

Direct Known Subclasses:
  Ajp13RequestHeaders, Ajp13ResponseHeaders, HttpHeaders, HttpHeaderValues

    public class BufferCache

extends Object

Stores a collection of `BufferCache.CachedBuffer` objects. Buffers are stored in an ordered collection and can retreived by index or value

Author:
  gregw

Nested Class Summary
`static class` `BufferCache.CachedBuffer`

Constructor Summary
`BufferCache()`

Method Summary
`BufferCache.CachedBuffer` `add(String value, int ordinal)` Add a buffer to the cache at the specified index.
`BufferCache.CachedBuffer` `get(Buffer buffer)`
`BufferCache.CachedBuffer` `get(int ordinal)`
`BufferCache.CachedBuffer` `get(String value)`
`BufferCache.CachedBuffer` `getBest(byte[] value, int offset, int maxLength)`
`int` `getOrdinal(Buffer buffer)`
`Buffer` `lookup(Buffer buffer)`
`Buffer` `lookup(String value)`
`String` `toString()`
`String` `toString(Buffer buffer)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### BufferCache

    public BufferCache()

Method Detail

### add

    public BufferCache.CachedBuffer add(String value,
                                        int ordinal)

  Add a buffer to the cache at the specified index.

  Parameters:
    `value` - The content of the buffer.

### get

    public BufferCache.CachedBuffer get(int ordinal)

### get

    public BufferCache.CachedBuffer get(Buffer buffer)

### get

    public BufferCache.CachedBuffer get(String value)

### lookup

    public Buffer lookup(Buffer buffer)

### getBest

    public BufferCache.CachedBuffer getBest(byte[] value,
                                            int offset,
                                            int maxLength)

### lookup

    public Buffer lookup(String value)

### toString

    public String toString(Buffer buffer)

### getOrdinal

    public int getOrdinal(Buffer buffer)

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Copyright © 1995-2008 Mort Bay Consulting. All Rights Reserved.