public abstract class SourceInputStream extends InputStream
| Constructor and Description |
|---|
SourceInputStream() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
adjustMaxCloneLimit(int limit)
Allow adjustment on the upper limit for number of maximum cloned streams allowed.
|
int |
available() |
abstract SourceInputStream |
cloneStream()
Clone a stream, the clone is a separate handle to the source data.
|
void |
close() |
abstract long |
getBytesRead()
Get total number of bytes read by current inputstream so far
Note1: this can be less than (e.g., not all bytes read) or larger than (e.g., repeated reads from part of the
input via seek operation) the physical size of the file underlying the input stream
Note2: this denotes the "meaningful" size of read, bytes read into buffer but discarded (e.g., due to seek
operation) are not accounted for.
|
abstract long |
getCurrentPos()
Getter for current position of the cursor, within the physical file
|
abstract String |
getFileName()
Getter for the file name associated with the file being streamed in.
|
abstract long |
getFileSize()
Getter for the size in [bytes] of the physical file currently being processed.
|
abstract long |
getSplitSize()
Getter for the split size supposedly assigned to the input stream.
|
abstract long |
getSplitStart()
Getter for the start position (within the physical stream) that is assigned to the input stream to process.
|
void |
mark(int readLimit) |
boolean |
markSupported() |
abstract int |
read()
Read one byte from stream.
|
abstract int |
read(byte[] b)
Reads some number of bytes from the input stream and stores them into the buffer array b.
|
abstract int |
read(byte[] b,
int offset,
int length)
Reads some number of bytes from the input stream and stores them into the buffer array b.
|
abstract int |
readToEnd(byte[] buffer)
An attempt to read rest of file content from current position (init to begin of file) to the end of
current file split (when file is not split up, it will read the entire file) into the supplied buffer.
|
void |
reset() |
abstract long |
skip(long n) |
public abstract int read(byte[] b,
int offset,
int length)
throws IOException
read in class InputStreamb - the buffer into which the data is readoffset - the start offset in array b at which the data is writtenlength - the maximum number of bytes to readIOExceptionpublic abstract int read(byte[] b)
throws IOException
read in class InputStreamb - the buffer into which the data is readIOExceptionpublic abstract int read()
throws IOException
read in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void mark(int readLimit)
mark in class InputStreampublic boolean markSupported()
markSupported in class InputStreampublic void reset()
reset in class InputStreampublic abstract long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic abstract String getFileName()
public abstract long getFileSize()
public abstract long getSplitStart()
SourceInputStream::getSplitSize() for more details.public abstract long getSplitSize()
public abstract long getCurrentPos()
throws IOException
IOExceptionpublic abstract int readToEnd(byte[] buffer)
throws IOException,
BufferOverflowException
buffer: - the byte buffer to host read-out bytes in a successful readIOExceptionBufferOverflowExceptionpublic abstract SourceInputStream cloneStream() throws IOException
IOExceptionpublic abstract void adjustMaxCloneLimit(int limit)
limit - public abstract long getBytesRead()
Copyright © 2023 Alibaba Cloud Computing. All rights reserved.