Interface RecvByteBufAllocator.Handle

All Known Subinterfaces:
RecvByteBufAllocator.ExtendedHandle
All Known Implementing Classes:
AdaptiveRecvByteBufAllocator.HandleImpl, DefaultMaxBytesRecvByteBufAllocator.HandleImpl, DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle, EpollRecvByteAllocatorHandle, EpollRecvByteAllocatorStreamingHandle, FixedRecvByteBufAllocator.HandleImpl, KQueueRecvByteAllocatorHandle, RecvByteBufAllocator.DelegatingHandle
Enclosing interface:
RecvByteBufAllocator

@Deprecated public static interface RecvByteBufAllocator.Handle
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.
    int
    Deprecated.
    Get how many bytes the read operation will (or did) attempt to read.
    void
    attemptedBytesRead(int bytes)
    Deprecated.
    Set how many bytes the read operation will (or did) attempt to read.
    boolean
    Deprecated.
    Determine if the current read loop should continue.
    int
    Deprecated.
    Similar to allocate(ByteBufAllocator) except that it does not allocate anything but just tells the capacity.
    void
    incMessagesRead(int numMessages)
    Deprecated.
    Increment the number of messages that have been read for the current read loop.
    int
    Deprecated.
    Get the amount of bytes for the previous read operation.
    void
    lastBytesRead(int bytes)
    Deprecated.
    Set the bytes that have been read for the last read operation.
    void
    Deprecated.
    The read has completed.
    void
    Deprecated.
    Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next read loop.
  • Method Details

    • allocate

      ByteBuf allocate(ByteBufAllocator alloc)
      Deprecated.
      Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.
    • guess

      int guess()
      Deprecated.
      Similar to allocate(ByteBufAllocator) except that it does not allocate anything but just tells the capacity.
    • reset

      void reset(ChannelConfig config)
      Deprecated.
      Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next read loop.

      This may be used by continueReading() to determine if the read operation should complete.

      This is only ever a hint and may be ignored by the implementation.
      Parameters:
      config - The channel configuration which may impact this object's behavior.
    • incMessagesRead

      void incMessagesRead(int numMessages)
      Deprecated.
      Increment the number of messages that have been read for the current read loop.
      Parameters:
      numMessages - The amount to increment by.
    • lastBytesRead

      void lastBytesRead(int bytes)
      Deprecated.
      Set the bytes that have been read for the last read operation. This may be used to increment the number of bytes that have been read.
      Parameters:
      bytes - The number of bytes from the previous read operation. This may be negative if an read error occurs. If a negative value is seen it is expected to be return on the next call to lastBytesRead(). A negative value will signal a termination condition enforced externally to this class and is not required to be enforced in continueReading().
    • lastBytesRead

      int lastBytesRead()
      Deprecated.
      Get the amount of bytes for the previous read operation.
      Returns:
      The amount of bytes for the previous read operation.
    • attemptedBytesRead

      void attemptedBytesRead(int bytes)
      Deprecated.
      Set how many bytes the read operation will (or did) attempt to read.
      Parameters:
      bytes - How many bytes the read operation will (or did) attempt to read.
    • attemptedBytesRead

      int attemptedBytesRead()
      Deprecated.
      Get how many bytes the read operation will (or did) attempt to read.
      Returns:
      How many bytes the read operation will (or did) attempt to read.
    • continueReading

      boolean continueReading()
      Deprecated.
      Determine if the current read loop should continue.
      Returns:
      true if the read loop should continue reading. false if the read loop is complete.
    • readComplete

      void readComplete()
      Deprecated.
      The read has completed.