org.eclipse.jetty.io

## Class BufferCache

- java.lang.Object
- - org.eclipse.jetty.io.BufferCache

- Direct Known Subclasses:
    Ajp13RequestHeaders, Ajp13ResponseHeaders, HttpHeaders, HttpHeaderValues

      public class BufferCache
      extends Object

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BufferCache.CachedBuffer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BufferCache()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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)`
    `int` | `getOrdinal(String value)`
    `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(String value)

    - #### getOrdinal

          public int getOrdinal(Buffer buffer)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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