This stream is buffered at packet sizes, so the caller doesn't need to wrap it in yet another buffered stream.
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| public static final int | CH_DATA
Channel used for pack data. |
| public static final int | CH_ERROR
Channel used for error messages. |
| public static final int | CH_PROGRESS
Channel used for progress messages. |
| private int | |
| pack-priv static final int | |
| public static final int | MAX_BUF
Maximum buffer size for a single packet of sideband data. |
| private final OutputStream | |
| public static final int | SMALL_BUF
Default buffer size for a small amount of data. |
| Access | Constructor and Description |
|---|---|
| public | SideBandOutputStream(int
channel number to prefix all packets with, so the remote side
can demultiplex the stream and get back the original data.
Must be in the range [1, 255]. chan, int maximum size of a data packet within the stream. The remote
side needs to agree to the packet size to prevent buffer
overflows. Must be in the range [HDR_SIZE + 1, MAX_BUF). sz, OutputStream stream that the packets are written onto. This stream should
be attached to a SideBandInputStream on the remote side. os)Create a new stream to write side band packets. |
| Modifier and Type | Method and Description |
|---|---|
| public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| pack-priv void | |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Writes |
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| private void |
| buffer | back to summary |
|---|---|
| private final byte[] buffer | |
| CH_DATA | back to summary |
|---|---|
| public static final int CH_DATA Channel used for pack data. | |
| CH_ERROR | back to summary |
|---|---|
| public static final int CH_ERROR Channel used for error messages. | |
| CH_PROGRESS | back to summary |
|---|---|
| public static final int CH_PROGRESS Channel used for progress messages. | |
| cnt | back to summary |
|---|---|
| private int cnt Number of bytes in
Initialized to | |
| HDR_SIZE | back to summary |
|---|---|
| pack-priv static final int HDR_SIZE | |
| MAX_BUF | back to summary |
|---|---|
| public static final int MAX_BUF Maximum buffer size for a single packet of sideband data. | |
| out | back to summary |
|---|---|
| private final OutputStream out | |
| SMALL_BUF | back to summary |
|---|---|
| public static final int SMALL_BUF Default buffer size for a small amount of data. | |
| SideBandOutputStream | back to summary |
|---|---|
| public SideBandOutputStream(int chan, int sz, OutputStream os) Create a new stream to write side band packets.
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| flushBuffer | back to summary |
|---|---|
| pack-priv void flushBuffer() throws IOException | |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| writeBuffer | back to summary |
|---|---|
| private void writeBuffer() throws IOException | |