}
@Override
- public void write(final int b) throws IOException {
+ public final void write(final int b) throws IOException {
count++;
out.write(b);
md.update((byte) b);
}
@Override
- public void write(final byte[] b, int off, int len)
+ public final void write(final byte[] b, int off, int len)
throws IOException {
while (0 < len) {
final int n = Math.min(len, BYTES_TO_WRITE_BEFORE_CANCEL_CHECK);
out.flush();
}
- void writeFileHeader(int version, long objectCount) throws IOException {
+ final void writeFileHeader(int version, long objectCount)
+ throws IOException {
System.arraycopy(Constants.PACK_SIGNATURE, 0, headerBuffer, 0, 4);
NB.encodeInt32(headerBuffer, 4, version);
NB.encodeInt32(headerBuffer, 8, (int) objectCount);
* examine the type of exception and possibly its message to
* distinguish between these cases.
*/
- public void writeObject(ObjectToPack otp) throws IOException {
+ public final void writeObject(ObjectToPack otp) throws IOException {
packWriter.writeObject(this, otp);
}
* @throws IOException
* the underlying stream refused to accept the header.
*/
- public void writeHeader(ObjectToPack otp, long rawLength)
+ public final void writeHeader(ObjectToPack otp, long rawLength)
throws IOException {
if (otp.isDeltaRepresentation()) {
if (packWriter.isDeltaBaseAsOffset()) {
}
}
- private int encodeTypeSize(int type, long rawLength) {
+ private final int encodeTypeSize(int type, long rawLength) {
long nextLength = rawLength >>> 4;
headerBuffer[0] = (byte) ((nextLength > 0 ? 0x80 : 0x00) | (type << 4) | (rawLength & 0x0F));
rawLength = nextLength;
}
/** @return a temporary buffer writers can use to copy data with. */
- public byte[] getCopyBuffer() {
+ public final byte[] getCopyBuffer() {
return copyBuffer;
}
}
/** @return total number of bytes written since stream start. */
- public long length() {
+ public final long length() {
return count;
}
/** @return obtain the current SHA-1 digest. */
- byte[] getDigest() {
+ final byte[] getDigest() {
return md.digest();
}
}