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.
Resize strategy for a
NetworkBuffer, used when a write needs more room than the capacity.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionlongresize(long capacity, long targetSize) Returns the new capacity for a buffer that needs to holdtargetSizebytes.
-
Field Details
-
DOUBLE
-
-
Method Details
-
resize
long resize(long capacity, long targetSize) Returns the new capacity for a buffer that needs to holdtargetSizebytes.- Parameters:
capacity- the current capacitytargetSize- the write index plus the number of bytes being written- Returns:
- the new capacity, which must be at least
targetSize
-