Class ByteArrayWrapper

java.lang.Object
com.helger.commons.io.ByteArrayWrapper
All Implemented Interfaces:
IHasByteArray, IHasInputStream, IHasInputStreamAndReader, IHasSize

@MustImplementEqualsAndHashcode public final class ByteArrayWrapper extends Object implements IHasByteArray
A straight forward implementation of IHasByteArray
Since:
9.1.3
Author:
Philip Helger
  • Constructor Details

    • ByteArrayWrapper

      public ByteArrayWrapper(@Nonnull byte[] aBytes, boolean bCopyNeeded)
      Wrap the whole byte array.
      Parameters:
      aBytes - The byte array to be wrapped. May not be null.
      bCopyNeeded - true to copy it, false to reuse the instance.
    • ByteArrayWrapper

      public ByteArrayWrapper(@Nonnull byte[] aBytes, @Nonnegative int nOfs, @Nonnegative int nLength, boolean bCopyNeeded)
      Wrap the passed byte array or just parts of it.
      Parameters:
      aBytes - The byte array to be wrapped. May not be null.
      nOfs - Offset. Must be ≥ 0.
      nLength - Length. Must be ≥ 0.
      bCopyNeeded - true to copy it, false to reuse the instance.
  • Method Details