|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.io.InputStream
|
+--org.metastatic.rsync.v2.MultiplexedInputStream
Handle multiplexed I/O for the rsync protocol.
| Field Summary | |
|---|---|
protected InputStream |
in
The underlying input stream. |
protected boolean |
multiplex
Whether or not to actually multiplex. |
protected int |
remaining
Used in readUnbuffered. |
protected Statistics |
stats
|
| Fields inherited from interface org.metastatic.rsync.v2.MultiplexedIO |
|---|
FERROR, FINFO, FLOG, FNONE, MPLEX_BASE |
| Constructor Summary | |
|---|---|
MultiplexedInputStream(InputStream in,
boolean multiplex)
|
|
| Method Summary | |
|---|---|
Statistics |
getStats()
|
int |
read()
|
int |
read(byte[] buf)
Attempt to read as many bytes as will fit into the buffer, blocking until it has been filled. |
int |
read(byte[] buf,
int off,
int len)
Attempt to fully read len bytes, blocking until all data is read. |
int |
readInt()
Read a little-endian ordered 32-bit integer. |
long |
readLong()
Read a little-endian ordered 64-bit long integer. |
String |
readString(int len)
Read len bytes, returning them as a String interpreted as US-ASCII. |
protected int |
readUnbuffered(byte[] buf,
int off,
int len)
Do an unbuffered read from the multiplexed input stream, putting normal data into the byte buffer and sending error stream data to #err. |
void |
setMultiplex(boolean multiplex)
|
void |
setStats(Statistics stats)
|
| Methods inherited from class java.io.InputStream |
|---|
available, close, mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected InputStream in
protected boolean multiplex
protected int remaining
protected Statistics stats
| Constructor Detail |
public MultiplexedInputStream(InputStream in,
boolean multiplex)
| Method Detail |
public void setStats(Statistics stats)
public Statistics getStats()
public void setMultiplex(boolean multiplex)
public int read()
throws IOException
read in class InputStreamIOException
public int read(byte[] buf,
int off,
int len)
throws IOException
read in class InputStreambuf - The buffer to read into.off - From whence to start storage in buf.len - The number of bytes to read.
IOException
public int read(byte[] buf)
throws IOException
read in class InputStreambuf - The buffer to read into.
IOException
public String readString(int len)
throws IOException
String interpreted as US-ASCII.
len - The number of bytes to read.
IOException
public int readInt()
throws IOException
IOException
public long readLong()
throws IOException
IOException
protected int readUnbuffered(byte[] buf,
int off,
int len)
throws IOException
#err.
buf - The byte buffer to read into.off - From whence in the buffer to begin.len - The number of bytes to attempt to read.
IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||