Top Description Inners Fields Constructors Methods
io.netty.channel

public Class FixedRecvByteBufAllocator

extends DefaultMaxMessagesRecvByteBufAllocator
Class Inheritance
Static Imports
io.netty.util.internal.ObjectUtil.checkPositive

The RecvByteBufAllocator that always yields the same buffer size prediction. This predictor ignores the feed back from the I/O thread.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
public
FixedRecvByteBufAllocator(int bufferSize)

Creates a new predictor that always returns the same prediction of the specified buffer size.

Method Summary

Modifier and TypeMethod and Description
public RecvByteBufAllocator.Handle
newHandle()

Implements io.netty.channel.RecvByteBufAllocator.newHandle.

Deprecated as a consequence of RecvByteBufAllocator.Handle being deprecated.
Creates a new handle.
public FixedRecvByteBufAllocator
respectMaybeMoreData(boolean
  • true to stop reading if we think there is no more data. This may save a system call to read from the socket, but if data has arrived in a racy fashion we may give up our maxMessagesPerRead() quantum and have to wait for the selector to notify us of more data.
  • false to keep reading (up to maxMessagesPerRead()) or until there is no data when we attempt to read.
respectMaybeMoreData
)

Overrides io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator.respectMaybeMoreData.

Determine if future instances of newHandle() will stop reading if we think there is no more data.
Inherited from io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator:
maxMessagesPerReadmaxMessagesPerReadrespectMaybeMoreData

Field Detail

bufferSizeback to summary
private final int bufferSize

Constructor Detail

FixedRecvByteBufAllocatorback to summary
public FixedRecvByteBufAllocator(int bufferSize)

Creates a new predictor that always returns the same prediction of the specified buffer size.

Method Detail

newHandleback to summary
public RecvByteBufAllocator.Handle newHandle()

Implements io.netty.channel.RecvByteBufAllocator.newHandle.

Doc from io.netty.channel.RecvByteBufAllocator.newHandle.

Deprecated

as a consequence of RecvByteBufAllocator.Handle being deprecated. See corresponding docs for further information.

Creates a new handle. The handle provides the actual operations and keeps the internal information which is required for predicting an optimal buffer capacity.

Annotations
@SuppressWarnings:deprecation
@Override
respectMaybeMoreDataback to summary
public FixedRecvByteBufAllocator respectMaybeMoreData(boolean respectMaybeMoreData)

Overrides io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator.respectMaybeMoreData.

Doc from io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator.respectMaybeMoreData.

Determine if future instances of newHandle() will stop reading if we think there is no more data.

Parameters
respectMaybeMoreData:boolean

  • true to stop reading if we think there is no more data. This may save a system call to read from the socket, but if data has arrived in a racy fashion we may give up our maxMessagesPerRead() quantum and have to wait for the selector to notify us of more data.
  • false to keep reading (up to maxMessagesPerRead()) or until there is no data when we attempt to read.
Returns:FixedRecvByteBufAllocator

this.

Annotations
@Override
io.netty.channel back to summary

private final Class FixedRecvByteBufAllocator.HandleImpl

extends MaxMessageHandle
Class Inheritance

Deprecated

as a consequence of DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle being deprecated. See corresponding docs for further information.

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
HandleImpl(int bufferSize)

Method Summary

Modifier and TypeMethod and Description
public int
guess()

Implements io.netty.channel.RecvByteBufAllocator.Handle.guess.

Similar to allocate(ByteBufAllocator) except that it does not allocate anything but just tells the capacity.
Inherited from io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle:
allocateattemptedBytesReadattemptedBytesReadcontinueReadingcontinueReadingincMessagesReadlastBytesReadlastBytesReadreadCompleteresettotalBytesRead

Field Detail

bufferSizeback to summary
private final int bufferSize

Constructor Detail

HandleImplback to summary
pack-priv HandleImpl(int bufferSize)

Method Detail

guessback to summary
public int guess()

Implements io.netty.channel.RecvByteBufAllocator.Handle.guess.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.guess.

Similar to allocate(ByteBufAllocator) except that it does not allocate anything but just tells the capacity.

Annotations
@Override