Class BufferedByteArray

java.lang.Object
de.das.encrypter.tools.BufferedByteArray

public class BufferedByteArray extends Object
This class provides the functionality of a buffered byte array. Instead of loading all data into memory, the data is managed in an external file and only loaded into memory in portions, so that array sizes of 100MB and larger can also be worked with without causing out-of-memory exceptions.
  • Constructor Details

  • Method Details

    • getByteAt

      public byte getByteAt(int position) throws Exception
      Throws:
      Exception
    • size

      public long size()
    • arrayCopy

      public void arrayCopy(int pos, byte[] target, int targetPos, int length) throws Exception
      Copies the given amount of bytes from this buffered byte array to the given target byte array starting at specified target position.
      Parameters:
      pos - specifies the starting position of this buffered byte array.
      target - specifies a byte array to copy the data to.
      targetPos - specifies the start position in the target byte array.
      length - specifies the amount of bytes to be copied.
      Throws:
      Exception - if the index is out of range for one of the byte arrays.