Class ByteBufferWindow

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

final class ByteBufferWindow extends ByteWindow
A window for accessing git packs using a ByteBuffer for storage.
See Also:
  • Field Details

  • Constructor Details

    • ByteBufferWindow

      ByteBufferWindow(Pack pack, long o, ByteBuffer 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.
    • write

      void write(PackOutputStream out, long pos, int cnt) throws IOException
      Specified by:
      write in class ByteWindow
      Throws:
      IOException
    • 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.