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.jboss.netty.channel
Interface ReceiveBufferSizePredictor

All Known Implementing Classes:
  AdaptiveReceiveBufferSizePredictor, FixedReceiveBufferSizePredictor

    public interface ReceiveBufferSizePredictor

Predicts the number of readable bytes in the receive buffer of a `Channel`.

It calculates the close-to-optimal capacity of the `ChannelBuffer` for the next read operation depending on the actual number of read bytes in the previous read operation. More accurate the prediction is, more effective the memory utilization will be.

Once a read operation is performed and the actual number of read bytes is known, an I/O thread will call `previousReceiveBufferSize(int)` to update the predictor so it can predict more accurately next time.

Version:
  $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
Author:
  The Netty Project, Trustin Lee

Method Summary
`int` | `nextReceiveBufferSize()` Predicts the capacity of the `ChannelBuffer` for the next read operation depending on the actual number of read bytes in the previous read operation.
`void` | `previousReceiveBufferSize(int previousReceiveBufferSize)` Updates this predictor by specifying the actual number of read bytes in the previous read operation.

Method Detail

### nextReceiveBufferSize

    int nextReceiveBufferSize()

  Predicts the capacity of the `ChannelBuffer` for the next read operation depending on the actual number of read bytes in the previous read operation.

  Returns:
    the expected number of readable bytes this time

### previousReceiveBufferSize

    void previousReceiveBufferSize(int previousReceiveBufferSize)

  Updates this predictor by specifying the actual number of read bytes in the previous read operation.

  Parameters:
    `previousReceiveBufferSize` - the actual number of read bytes in the previous read operation

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 © 2008-2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.