SdkBufferedInputStream
.
A repeatable input stream wrapper for any input stream. This input stream
relies on buffered data to repeat, and can therefore only be repeated when
less data has been read than this buffer can hold.
Note: Always use a ResettableInputStream
instead of this
class if you are sourcing data from a file, as the file-based repeatable
input stream can be repeated without any limitations.
@Deprecated public class RepeatableInputStream extends SdkInputStream
Constructor and Description |
---|
RepeatableInputStream(InputStream inputStream,
int bufferSize)
Deprecated.
Creates a repeatable input stream based on another input stream.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Deprecated.
|
void |
close()
Deprecated.
|
InputStream |
getWrappedInputStream()
Deprecated.
|
void |
mark(int readlimit)
Deprecated.
This method can only be used while less data has been read from the input
stream than fits into the buffer.
|
boolean |
markSupported()
Deprecated.
|
int |
read()
Deprecated.
|
int |
read(byte[] out,
int outOffset,
int outLength)
Deprecated.
|
void |
reset()
Deprecated.
Resets the input stream to the beginning by pointing the buffer offset to
the beginning of the available data buffer.
|
abort, abortIfNeeded, isMetricActivated, release
read, skip
public RepeatableInputStream(InputStream inputStream, int bufferSize)
inputStream
- The input stream to wrap. The data read from the wrapped input
stream is buffered as it is read, up to the buffer limit
specified.bufferSize
- The number of bytes buffered by this class.public void reset() throws IOException
reset
in class InputStream
IOException
- When the available buffer size has been exceeded, in which
case the input stream data cannot be repeated.public boolean markSupported()
markSupported
in class InputStream
InputStream.markSupported()
public void mark(int readlimit)
mark
in class InputStream
public int available() throws IOException
available
in class InputStream
IOException
InputStream.available()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
InputStream.close()
public int read(byte[] out, int outOffset, int outLength) throws IOException
read
in class InputStream
IOException
InputStream.read(byte[], int, int)
public int read() throws IOException
read
in class InputStream
IOException
InputStream.read()
public InputStream getWrappedInputStream()
getWrappedInputStream
in class SdkInputStream
Copyright © 2021. All rights reserved.