Interface NetworkBuffer.AutoResize

Enclosing interface:
NetworkBuffer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface NetworkBuffer.AutoResize
Resize strategy for a NetworkBuffer, used when a write needs more room than the capacity.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    resize(long capacity, long targetSize)
    Returns the new capacity for a buffer that needs to hold targetSize bytes.
  • Field Details

  • Method Details

    • resize

      long resize(long capacity, long targetSize)
      Returns the new capacity for a buffer that needs to hold targetSize bytes.
      Parameters:
      capacity - the current capacity
      targetSize - the write index plus the number of bytes being written
      Returns:
      the new capacity, which must be at least targetSize