Class ReadBufferWaterMark

java.lang.Object
org.drasyl.channel.ReadBufferWaterMark

public final class ReadBufferWaterMark extends Object
ReadBufferWaterMark is used to set low water mark and high water mark for the read buffer.

If the number of bytes queued in the reads buffer exceeds the high water mark, DrasylChannel.isReadBufferFull() will start to return true.

If the number of bytes queued in the read buffer exceeds the high water mark and then dropped down below the low water mark, DrasylChannel.isReadBufferFull() will start to return true again.

  • Field Details

  • Constructor Details

    • ReadBufferWaterMark

      public ReadBufferWaterMark(int low, int high)
      Create a new instance.
      Parameters:
      low - low water mark for read buffer.
      high - high water mark for read buffer
  • Method Details

    • low

      public int low()
      Returns the low water mark for the read buffer.
    • high

      public int high()
      Returns the high water mark for the read buffer.
    • toString

      public String toString()
      Overrides:
      toString in class Object