Interface BytePool

All Known Implementing Classes:
ByteUnpool, LevelBytePool, ZeroBytePool

public interface BytePool
Represents a pool for byte arrays. It allows to claim byte arrays of at least a specified minimum length.
Since:
1.8
  • Method Summary

    Modifier and Type
    Method
    Description
    Pooled<byte[]>
    claim(int minLength)
    Claims a byte array that is at least as long as the specified minimum length.
    default Pool<byte[]>
    ofLength(int minLength)
    Returns a pool that provides byte arrays that are at least as long as the specified minimum length.
  • Method Details

    • claim

      Pooled<byte[]> claim(int minLength)
      Claims a byte array that is at least as long as the specified minimum length.
      Parameters:
      minLength - The minimum required length of the byte array.
      Returns:
      A Pooled instance wrapping a byte array of at least the specified minimum length.
    • ofLength

      default Pool<byte[]> ofLength(int minLength)
      Returns a pool that provides byte arrays that are at least as long as the specified minimum length.
      Parameters:
      minLength - The minimum required length of the byte arrays.
      Returns:
      A Pool instance for byte arrays of at least the specified minimum length.