new InputStream()
Represents an instance of an InputStream
Do not call constructor directly
Do not call constructor directly
- Source:
Methods
available() → {string}
Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. The next invocation might be the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes.
Note that while some implementations of InputStream will return the total number of bytes in the stream, many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream.
A subclass' implementation of this method may choose to throw an IOException if this input stream has been closed by invoking the close() method.
Note that while some implementations of InputStream will return the total number of bytes in the stream, many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream.
A subclass' implementation of this method may choose to throw an IOException if this input stream has been closed by invoking the close() method.
- Source:
Returns:
an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking or 0 when it reaches the end of the input stream.
- Type
- string
close()
Closes this InputStream instance
- Source:
mark(readlimit) → {string}
Marks the current position in this input stream. A subsequent call to the reset method repositions this stream at the last marked position so that subsequent reads re-read the same bytes.
The readlimit arguments tells this input stream to allow that many bytes to be read before the mark position gets invalidated.
The general contract of mark is that, if the method markSupported returns true, the stream somehow remembers all the bytes read after the call to mark and stands ready to supply those same bytes again if and whenever the method reset is called. However, the stream is not required to remember any data at all if more than readlimit bytes are read from the stream before reset is called.
Marking a closed stream should not have any effect on the stream.
The readlimit arguments tells this input stream to allow that many bytes to be read before the mark position gets invalidated.
The general contract of mark is that, if the method markSupported returns true, the stream somehow remembers all the bytes read after the call to mark and stands ready to supply those same bytes again if and whenever the method reset is called. However, the stream is not required to remember any data at all if more than readlimit bytes are read from the stream before reset is called.
Marking a closed stream should not have any effect on the stream.
Parameters:
Name | Type | Description |
---|---|---|
readlimit |
integer | the maximum limit of bytes that can be read before the mark position becomes invalid. |
- Source:
Returns:
an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking or 0 when it reaches the end of the input stream.
- Type
- string
markSupported() → {boolean}
Tests if this input stream supports the mark and reset methods. Whether or not mark and reset are supported is an invariant property of a particular input stream instance. The markSupported method of InputStream returns false.
- Source:
Returns:
true if this stream instance supports the mark and reset methods; false otherwise.true if this stream instance supports the mark and reset methods; false otherwise.an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking or 0 when it reaches the end of the input stream.
- Type
- boolean
read() → {byte}
Reads the next single byte
- Source:
Returns:
the next single byte
- Type
- byte
readBytes() → {Array.<byte>}
Reads an array of single from an offset with a specific length
- Source:
Returns:
the array of byte
- Type
- Array.<byte>
readText() → {string}
Reads a string/text of from an offset with a specific length
- Source:
Returns:
the resulting string
- Type
- string
reset()
Repositions this stream to the position at the time the mark method was last called on this input stream.
- Source:
skip(the) → {string}
Skips a number of bytes
Parameters:
Name | Type | Description |
---|---|---|
the |
integer | number of bytes to be skipped. |
- Source:
Returns:
the actual number of bytes skipped.
- Type
- string
toText() → {string}
Fully reads/convert the InputStream content to a string
- Source:
Returns:
the content of this stream
- Type
- string