Class ByteUnpool

java.lang.Object
de.tomatengames.util.pool.ByteUnpool
All Implemented Interfaces:
BytePool

public class ByteUnpool extends Object implements BytePool
Represents an implementation of BytePool that does not reuse byte arrays. Instead, it simply creates a new byte array each time claim is called, with exactly the requested length.
Since:
1.8
  • Constructor Details

    • ByteUnpool

      public ByteUnpool()
      Creates a new ByteUnpool.
  • Method Details

    • claim

      public Pooled<byte[]> claim(int minLength)
      Description copied from interface: BytePool
      Claims a byte array that is at least as long as the specified minimum length.
      Specified by:
      claim in interface BytePool
      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.