org.eclipse.jgit.internal.storage.pack.BinaryDelta .
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final int | |
| private static final int | MAX_COPY_CMD_SIZE
Maximum number of bytes used by a copy instruction. |
| private static final int | MAX_INSERT_DATA_SIZE
Maximum length that an insert command can encode at once. |
| private static final int | MAX_V2_COPY
Maximum number of bytes to be copied in pack v2 format. |
| private final OutputStream | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | DeltaEncoder(OutputStream
buffer to store the instructions written. out, long size of the base object, in bytes. baseSize, long size of the resulting object, after applying this instruction
stream to the base object, in bytes. resultSize)Create an encoder with no upper bound on the instruction stream size. |
| public | DeltaEncoder(OutputStream
buffer to store the instructions written. out, long size of the base object, in bytes. baseSize, long size of the resulting object, after applying this instruction
stream to the base object, in bytes. resultSize, int maximum number of bytes to write to the out buffer declaring
the stream is over limit and should be discarded. May be 0 to
specify an infinite limit. limit)Create an encoder with an upper limit on the instruction size. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the copy fits within the limit; false if the copy would cause the instruction stream to exceed the limit.position in the base object to copy from. This is absolute,
from the beginning of the base. offset, int number of bytes to copy. cnt)Create a copy instruction to copy from the base object. |
| private int | |
| public int | Returns: current size of the delta stream, in bytes.Get current size of the delta stream, in bytes. |
| public boolean | |
| public boolean | Returns: true if the insert fits within the limit; false if the insert would cause the instruction stream to exceed the limit.the binary to insert. text)Insert a literal binary sequence. |
| public boolean | Returns: true if the insert fits within the limit; false if the insert would cause the instruction stream to exceed the limit.the binary to insert. text, int offset within off, int text to start copying from.number of bytes to insert. cnt)Insert a literal binary sequence. |
| private void |
| buf | back to summary |
|---|---|
| private final byte[] buf | |
| limit | back to summary |
|---|---|
| private final int limit | |
| MAX_COPY_CMD_SIZE | back to summary |
|---|---|
| private static final int MAX_COPY_CMD_SIZE Maximum number of bytes used by a copy instruction. | |
| MAX_INSERT_DATA_SIZE | back to summary |
|---|---|
| private static final int MAX_INSERT_DATA_SIZE Maximum length that an insert command can encode at once. | |
| MAX_V2_COPY | back to summary |
|---|---|
| private static final int MAX_V2_COPY Maximum number of bytes to be copied in pack v2 format. Historical limitations have this at 64k, even though current delta decoders recognize larger copy instructions. | |
| out | back to summary |
|---|---|
| private final OutputStream out | |
| size | back to summary |
|---|---|
| private int size | |
| DeltaEncoder | back to summary |
|---|---|
| public DeltaEncoder(OutputStream out, long baseSize, long resultSize) throws IOException Create an encoder with no upper bound on the instruction stream size.
| |
| DeltaEncoder | back to summary |
|---|---|
| public DeltaEncoder(OutputStream out, long baseSize, long resultSize, int limit) throws IOException Create an encoder with an upper limit on the instruction size.
| |
| copy | back to summary |
|---|---|
| public boolean copy(long offset, int cnt) throws IOException Create a copy instruction to copy from the base object.
| |
| encodeCopy | back to summary |
|---|---|
| private int encodeCopy(int p, long offset, int cnt) | |
| getSize | back to summary |
|---|---|
| public int getSize() Get current size of the delta stream, in bytes.
| |
| insert | back to summary |
|---|---|
| public boolean insert(String text) throws IOException Insert a literal string of text, in UTF-8 encoding.
| |
| insert | back to summary |
|---|---|
| public boolean insert(byte[] text) throws IOException Insert a literal binary sequence.
| |
| insert | back to summary |
|---|---|
| public boolean insert(byte[] text, int off, int cnt) throws IOException Insert a literal binary sequence.
| |
| writeVarint | back to summary |
|---|---|
| private void writeVarint(long sz) throws IOException | |