Package org.eclipse.jgit.transport
Class SideBandInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.eclipse.jgit.transport.SideBandInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class SideBandInputStream extends java.io.InputStreamUnmultiplexes 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:
SideBandOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private intavailable(package private) static intCH_DATA(package private) static intCH_ERROR(package private) static intCH_PROGRESSprivate intchannelprivate java.lang.StringcurrentTaskprivate booleaneofprivate intlastCntprivate java.io.Writermessagesprivate ProgressMonitormonitorprivate java.io.OutputStreamoutprivate static java.util.regex.PatternP_BOUNDEDprivate static java.util.regex.PatternP_UNBOUNDEDprivate PacketLineInpckInprivate java.lang.StringprogressBufferprivate java.io.InputStreamrawIn
-
Constructor Summary
Constructors Constructor Description SideBandInputStream(java.io.InputStream in, ProgressMonitor progress, java.io.Writer messageStream, java.io.OutputStream outputStream)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidbeginTask(int totalWorkUnits)private voiddoProgressLine(java.lang.String msg)private voidneedDataPacket()private voidprogress(java.lang.String pkt)intread()intread(byte[] b, int off, int len)private java.lang.StringreadString(int len)private static java.lang.Stringremote(java.lang.String msg)
-
-
-
Field Detail
-
CH_DATA
static final int CH_DATA
- See Also:
- Constant Field Values
-
CH_PROGRESS
static final int CH_PROGRESS
- See Also:
- Constant Field Values
-
CH_ERROR
static final int CH_ERROR
- See Also:
- Constant Field Values
-
P_UNBOUNDED
private static java.util.regex.Pattern P_UNBOUNDED
-
P_BOUNDED
private static java.util.regex.Pattern P_BOUNDED
-
rawIn
private final java.io.InputStream rawIn
-
pckIn
private final PacketLineIn pckIn
-
monitor
private final ProgressMonitor monitor
-
messages
private final java.io.Writer messages
-
out
private final java.io.OutputStream out
-
progressBuffer
private java.lang.String progressBuffer
-
currentTask
private java.lang.String currentTask
-
lastCnt
private int lastCnt
-
eof
private boolean eof
-
channel
private int channel
-
available
private int available
-
-
Constructor Detail
-
SideBandInputStream
SideBandInputStream(java.io.InputStream in, ProgressMonitor progress, java.io.Writer messageStream, java.io.OutputStream outputStream)
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
needDataPacket
private void needDataPacket() throws java.io.IOException- Throws:
java.io.IOException
-
progress
private void progress(java.lang.String pkt) throws java.io.IOException- Throws:
java.io.IOException
-
doProgressLine
private void doProgressLine(java.lang.String msg) throws java.io.IOException- Throws:
java.io.IOException
-
beginTask
private void beginTask(int totalWorkUnits)
-
remote
private static java.lang.String remote(java.lang.String msg)
-
readString
private java.lang.String readString(int len) throws java.io.IOException- Throws:
java.io.IOException
-
-