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.InputStream
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:
SideBandOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private int
available
(package private) static int
CH_DATA
(package private) static int
CH_ERROR
(package private) static int
CH_PROGRESS
private int
channel
private java.lang.String
currentTask
private boolean
eof
private int
lastCnt
private java.io.Writer
messages
private ProgressMonitor
monitor
private java.io.OutputStream
out
private static java.util.regex.Pattern
P_BOUNDED
private static java.util.regex.Pattern
P_UNBOUNDED
private PacketLineIn
pckIn
private java.lang.String
progressBuffer
private java.io.InputStream
rawIn
-
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 void
beginTask(int totalWorkUnits)
private void
doProgressLine(java.lang.String msg)
private void
needDataPacket()
private void
progress(java.lang.String pkt)
int
read()
int
read(byte[] b, int off, int len)
private java.lang.String
readString(int len)
private static java.lang.String
remote(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:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in 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
-
-