Package org.eclipse.jgit.util.io
Class BinaryHunkOutputStream
java.lang.Object
java.io.OutputStream
org.eclipse.jgit.util.io.BinaryHunkOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
An
OutputStream
that encodes data for a git binary patch.- Since:
- 5.12
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
private static final int
private final OutputStream
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Flushes and closes this stream, and closes the underlyingOutputStream
.private void
encode
(byte[] data, int off, int length) void
flush()
Writes any buffered output as a binary patch line to the underlyingOutputStream
and flushes that stream, too.void
write
(byte[] b, int off, int len) void
write
(int b) Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Field Details
-
MAX_BYTES
private static final int MAX_BYTES- See Also:
-
out
-
buffer
private final byte[] buffer -
pos
private int pos
-
-
Constructor Details
-
BinaryHunkOutputStream
Creates a newBinaryHunkOutputStream
.- Parameters:
out
-OutputStream
to write the encoded data to
-
-
Method Details
-
close
Flushes and closes this stream, and closes the underlyingOutputStream
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
Writes any buffered output as a binary patch line to the underlyingOutputStream
and flushes that stream, too.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
encode
- Throws:
IOException
-