org.eclipse.jgit.util.TemporaryBuffer , where any data read or skipped
by the caller is also duplicated into the temporary buffer. Later the
temporary buffer can then be used instead of the original source stream.
During close this stream copies any remaining data from the source stream
into the destination stream.
| Modifier and Type | Field and Description |
|---|---|
| private OutputStream | |
| private byte[] | |
| private InputStream |
| Access | Constructor and Description |
|---|---|
| public | TeeInputStream(InputStream
source stream to consume. src, OutputStream destination to copy the source to as it is consumed. Typically
this is a dst)org..Initialize a tee input stream. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this input stream and releases any system resources associated with the stream. |
| public int | read()
Implements abstract java. Reads the next byte of data from the input stream. |
| public int | read(byte[]
the buffer into which the data is read. b, int the start offset in array off, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. Reads up to |
| public long | skip(long
the number of bytes to be skipped. count)Overrides java. Skips over and discards |
| private byte[] |
| dst | back to summary |
|---|---|
| private OutputStream dst | |
| skipBuffer | back to summary |
|---|---|
| private byte[] skipBuffer | |
| src | back to summary |
|---|---|
| private InputStream src | |
| TeeInputStream | back to summary |
|---|---|
| public TeeInputStream(InputStream src, OutputStream dst) Initialize a tee input stream.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |
| skip | back to summary |
|---|---|
| public long skip(long count) throws IOException Overrides java. Doc from java. Skips over and discards
| |
| skipBuffer | back to summary |
|---|---|
| private byte[] skipBuffer() | |