All bytes in the window can be assumed to be "immediately available", that is they are very likely already in memory, unless the operating system's memory is very low and has paged part of this process out to disk. Therefore copying bytes from a window is very inexpensive.
| Modifier and Type | Field and Description |
|---|---|
| protected final long | |
| protected final Pack | |
| protected final long |
| Access | Constructor and Description |
|---|---|
| protected | ByteWindow(Pack p, long
where the byte window starts in the pack file s, int size of the byte window n)Constructor for ByteWindow. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final boolean | |
| pack-priv final int | Returns: number of bytes actually copied; this may be less thancnt if cnt exceeded the number of
bytes available.offset within the file to start copying from. pos, byte[] destination buffer to copy into. dstbuf, int offset within dstoff, int dstbuf to start copying into.number of bytes to copy. This value may exceed the number of
bytes remaining in the window starting at offset
cnt)pos.Copy bytes from the window to a caller supplied buffer. |
| protected abstract int | Returns: number of bytes actually copied; this may be less thancnt if cnt exceeded the number of
bytes available.offset within the window to start copying from. pos, byte[] destination buffer to copy into. dstbuf, int offset within dstoff, int dstbuf to start copying into.number of bytes to copy. This value may exceed the number of
bytes remaining in the window starting at offset
cnt)pos.Copy bytes from the window to a caller supplied buffer. |
| pack-priv final int | |
| protected abstract int | Returns: size of the byte windowposition pos, Inflater an inf)java. object.Set the input |
| pack-priv final int | |
| pack-priv abstract void |
| end | back to summary |
|---|---|
| protected final long end | |
| pack | back to summary |
|---|---|
| protected final Pack pack | |
| start | back to summary |
|---|---|
| protected final long start | |
| ByteWindow | back to summary |
|---|---|
| protected ByteWindow(Pack p, long s, int n) Constructor for ByteWindow.
| |
| contains | back to summary |
|---|---|
| pack-priv final boolean contains(Pack neededPack, long neededPos) | |
| copy | back to summary |
|---|---|
| pack-priv final int copy(long pos, byte[] dstbuf, int dstoff, int cnt) Copy bytes from the window to a caller supplied buffer.
| |
| copy | back to summary |
|---|---|
| protected abstract int copy(int pos, byte[] dstbuf, int dstoff, int cnt) Copy bytes from the window to a caller supplied buffer.
| |
| setInput | back to summary |
|---|---|
| pack-priv final int setInput(long pos, Inflater inf) throws DataFormatException | |
| setInput | back to summary |
|---|---|
| protected abstract int setInput(int pos, Inflater inf) throws DataFormatException Set the input
| |
| size | back to summary |
|---|---|
| pack-priv final int size() | |
| write | back to summary |
|---|---|
| pack-priv abstract void write(PackOutputStream out, long pos, int cnt) throws IOException | |