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 intprivate final OutputStreamprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Flushes and closes this stream, and closes the underlyingOutputStream.private voidencode(byte[] data, int off, int length) voidflush()Writes any buffered output as a binary patch line to the underlyingOutputStreamand flushes that stream, too.voidwrite(byte[] b, int off, int len) voidwrite(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-OutputStreamto write the encoded data to
-
-
Method Details
-
close
Flushes and closes this stream, and closes the underlyingOutputStream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
Writes any buffered output as a binary patch line to the underlyingOutputStreamand flushes that stream, too.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
encode
- Throws:
IOException
-