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 aByteBufferfor storage.- See Also:
ByteWindow
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBufferbuffer-
Fields inherited from class org.eclipse.jgit.internal.storage.file.ByteWindow
end, pack, start
-
-
Constructor Summary
Constructors Constructor Description ByteBufferWindow(Pack pack, long o, java.nio.ByteBuffer b)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcopy(int p, byte[] b, int o, int n)Copy bytes from the window to a caller supplied buffer.protected intsetInput(int pos, java.util.zip.Inflater inf)Set the input(package private) voidwrite(PackOutputStream out, long pos, int cnt)-
Methods inherited from class org.eclipse.jgit.internal.storage.file.ByteWindow
contains, copy, setInput, size
-
-
-
-
Constructor Detail
-
ByteBufferWindow
ByteBufferWindow(Pack pack, long o, java.nio.ByteBuffer b)
-
-
Method Detail
-
copy
protected int copy(int p, byte[] b, int o, int n)Copy bytes from the window to a caller supplied buffer.- Specified by:
copyin classByteWindow- Parameters:
p- offset within the window to start copying from.b- destination buffer to copy into.o- offset withindstbufto start copying into.n- number of bytes to copy. This value may exceed the number of bytes remaining in the window starting at offsetpos.- Returns:
- number of bytes actually copied; this may be less than
cntifcntexceeded the number of bytes available.
-
write
void write(PackOutputStream out, long pos, int cnt) throws java.io.IOException
- Specified by:
writein classByteWindow- Throws:
java.io.IOException
-
setInput
protected int setInput(int pos, java.util.zip.Inflater inf) throws java.util.zip.DataFormatExceptionSet the input- Specified by:
setInputin classByteWindow- Parameters:
pos- positioninf- anInflaterobject.- Returns:
- size of the byte window
- Throws:
java.util.zip.DataFormatException- if any.
-
-