## org.eclipse.jetty.io
Class ThreadLocalBuffers

    java.lang.Object
      org.eclipse.jetty.io.ThreadLocalBuffers

All Implemented Interfaces:
  Buffers

    public abstract class ThreadLocalBuffers

extends Object
implements Buffers

Abstract Buffer pool. simple unbounded pool of buffers for header, request and response sizes.

Nested Class Summary
`protected static class` `ThreadLocalBuffers.ThreadBuffers`

Constructor Summary
`ThreadLocalBuffers()`

Method Summary
`Buffer` `getBuffer()`
`Buffer` `getBuffer(int size)`
`int` `getBufferSize()`
`Buffer` `getHeader()`
`int` `getHeaderSize()`
`protected abstract boolean` `isHeader(Buffer buffer)`
`protected abstract Buffer` `newBuffer(int size)` Create a new content Buffer
`protected abstract Buffer` `newHeader(int size)` Create a new header Buffer
`void` `returnBuffer(Buffer buffer)`
`void` `setBufferSize(int size)`
`void` `setHeaderSize(int size)`
`String` `toString()`

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

Constructor Detail

### ThreadLocalBuffers

    public ThreadLocalBuffers()

Method Detail

### getBuffer

    public Buffer getBuffer()

  Specified by:
    `getBuffer` in interface `Buffers`

### getHeader

    public Buffer getHeader()

  Specified by:
    `getHeader` in interface `Buffers`

### getBuffer

    public Buffer getBuffer(int size)

  Specified by:
    `getBuffer` in interface `Buffers`

### returnBuffer

    public void returnBuffer(Buffer buffer)

  Specified by:
    `returnBuffer` in interface `Buffers`

### getBufferSize

    public int getBufferSize()

  Returns:
    Returns the buffer size in bytes.

### getHeaderSize

    public int getHeaderSize()

  Returns:
    Returns the header size in bytes.

### newBuffer

    protected abstract Buffer newBuffer(int size)

  Create a new content Buffer

  Parameters:
    `size` -
  Returns:
    new Buffer

### newHeader

    protected abstract Buffer newHeader(int size)

  Create a new header Buffer

  Parameters:
    `size` -
  Returns:
    new Buffer

### isHeader

    protected abstract boolean isHeader(Buffer buffer)

  Parameters:
    `buffer` -
  Returns:
    True if the buffer is the correct type to be a Header buffer

### setBufferSize

    public void setBufferSize(int size)

  Parameters:
    `size` - The buffer size in bytes

### setHeaderSize

    public void setHeaderSize(int size)

  Parameters:
    `size` - The header size in bytes

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

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