public class BufferedInputStreamMultiplexer extends Object
InputStream
instances, and any of them will
read the same data coming from another source InputStream
, from the beginning of that source input
stream.
The data will be buffered in a File
on disk. Whenver a client input stream reads farther than any
other client input stream has read, more data will be read from the source input stream and put into the buffer.
Any client input stream can be closed, but that does not close the source input stream.Modifier and Type | Class and Description |
---|---|
protected static class |
BufferedInputStreamMultiplexer.AbstractBuffer
Abstract buffer, implementing shared functionality.
|
static interface |
BufferedInputStreamMultiplexer.Buffer
Interface for a buffer to store the source data so it can be read again.
|
static class |
BufferedInputStreamMultiplexer.FileBuffer
File-backed buffer.
|
static class |
BufferedInputStreamMultiplexer.MemoryBuffer
Memory-backed buffer.
|
static class |
BufferedInputStreamMultiplexer.MultiplexerInputStream
Input stream that can also provide the number of bytes read.
|
Constructor and Description |
---|
BufferedInputStreamMultiplexer(InputStream source,
BufferedInputStreamMultiplexer.Buffer buffer)
Create a buffered input stream multiplexer, using the provided input stream as source for the data,
and buffering the data in the provided buffer.
|
Modifier and Type | Method and Description |
---|---|
BufferedInputStreamMultiplexer.MultiplexerInputStream |
getInputStream()
Create another input stream reading the same data from the beginning.
|
public BufferedInputStreamMultiplexer(InputStream source, BufferedInputStreamMultiplexer.Buffer buffer)
source
- source input streambuffer
- buffer to usepublic BufferedInputStreamMultiplexer.MultiplexerInputStream getInputStream() throws FileNotFoundException
FileNotFoundException
- if the file is not foundCopyright © 2016–2023. All rights reserved.