Package org.eclipse.jgit.transport
Class SideBandInputStream
java.lang.Object
java.io.InputStream
org.eclipse.jgit.transport.SideBandInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Unmultiplexes the data portion of a side-band channel.
Reading from this input stream obtains data from channel 1, which is typically the bulk data stream.
Channel 2 is transparently unpacked and "scraped" to update a progress monitor. The scraping is performed behind the scenes as part of any of the read methods offered by this stream.
Channel 3 results in an exception being thrown, as the remote side has issued an unrecoverable error.
- Since:
- 4.11
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int(package private) static final int(package private) static final int(package private) static final intprivate intprivate Stringprivate booleanprivate intprivate final Writerprivate final ProgressMonitorprivate final OutputStreamprivate static Patternprivate static Patternprivate final PacketLineInprivate Stringprivate final InputStream -
Constructor Summary
ConstructorsConstructorDescriptionSideBandInputStream(InputStream in, ProgressMonitor progress, Writer messageStream, OutputStream outputStream) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbeginTask(int totalWorkUnits) private voiddoProgressLine(String msg) private voidprivate voidintread()intread(byte[] b, int off, int len) private StringreadString(int len) private static StringMethods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
CH_DATA
static final int CH_DATA- See Also:
-
CH_PROGRESS
static final int CH_PROGRESS- See Also:
-
CH_ERROR
static final int CH_ERROR- See Also:
-
P_UNBOUNDED
-
P_BOUNDED
-
rawIn
-
pckIn
-
monitor
-
messages
-
out
-
progressBuffer
-
currentTask
-
lastCnt
private int lastCnt -
eof
private boolean eof -
channel
private int channel -
available
private int available
-
-
Constructor Details
-
SideBandInputStream
SideBandInputStream(InputStream in, ProgressMonitor progress, Writer messageStream, OutputStream outputStream)
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
needDataPacket
- Throws:
IOException
-
progress
- Throws:
IOException
-
doProgressLine
- Throws:
IOException
-
beginTask
private void beginTask(int totalWorkUnits) -
remote
-
readString
- Throws:
IOException
-