Class ByteArrayWindow

java.lang.Object
org.eclipse.jgit.internal.storage.file.ByteWindow
org.eclipse.jgit.internal.storage.file.ByteArrayWindow

final class ByteArrayWindow extends ByteWindow
A ByteWindow with an underlying byte array for storage.
  • Field Details

    • array

      private final byte[] array
  • Constructor Details

    • ByteArrayWindow

      ByteArrayWindow(Pack pack, long o, byte[] b)
  • Method Details

    • copy

      protected int copy(int p, byte[] b, int o, int n)
      Copy bytes from the window to a caller supplied buffer.
      Specified by:
      copy in class ByteWindow
      Parameters:
      p - offset within the window to start copying from.
      b - destination buffer to copy into.
      o - offset within dstbuf to start copying into.
      n - number of bytes to copy. This value may exceed the number of bytes remaining in the window starting at offset pos.
      Returns:
      number of bytes actually copied; this may be less than cnt if cnt exceeded the number of bytes available.
    • setInput

      protected int setInput(int pos, Inflater inf) throws DataFormatException
      Set the input
      Specified by:
      setInput in class ByteWindow
      Parameters:
      pos - position
      inf - an Inflater object.
      Returns:
      size of the byte window
      Throws:
      DataFormatException - if any.
    • crc32

      void crc32(CRC32 out, long pos, int cnt)
    • write

      void write(PackOutputStream out, long pos, int cnt) throws IOException
      Specified by:
      write in class ByteWindow
      Throws:
      IOException
    • check

      void check(Inflater inf, byte[] tmp, long pos, int cnt) throws DataFormatException
      Throws:
      DataFormatException