Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
InputStream
net.sf.saxon.dotnet.DotNetInputStream
public class DotNetInputStream
extends InputStream
Constructor Summary | |
|
Method Summary | |
void |
|
Stream |
|
void |
|
boolean |
|
int |
|
int |
|
void |
|
public void close() throws IOException
Closes this output stream and releases any system resources associated with this stream. The general contract ofclose
is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened. Theclose
method ofOutputStream
does nothing.
public Stream getUnderlyingStream()
Get the underlying .NET Stream object
public void mark(int readlimit)
Marks the current position in this input stream. A subsequent call to thereset
method repositions this stream at the last marked position so that subsequent reads re-read the same bytes. Thereadlimit
arguments tells this input stream to allow that many bytes to be read before the mark position gets invalidated. The general contract ofmark
is that, if the methodmarkSupported
returnstrue
, the stream somehow remembers all the bytes read after the call tomark
and stands ready to supply those same bytes again if and whenever the methodreset
is called. However, the stream is not required to remember any data at all if more thanreadlimit
bytes are read from the stream beforereset
is called. Themark
method ofInputStream
does nothing.
- Parameters:
readlimit
- the maximum limit of bytes that can be read before the mark position becomes invalid.
- See Also:
java.io.InputStream.reset()
public boolean markSupported()
Tests if this input stream supports themark
andreset
methods. Whether or notmark
andreset
are supported is an invariant property of a particular input stream instance.
- Returns:
true
if this stream instance supports the mark and reset methods;false
otherwise.
- See Also:
java.io.InputStream.mark(int)
,java.io.InputStream.reset()
public int read() throws IOException
Reads the next byte of data from the input stream. The value byte is returned as anint
in the range0
to255
. If no byte is available because the end of the stream has been reached, the value-1
is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. A subclass must provide an implementation of this method.
- Returns:
- the next byte of data, or
-1
if the end of the stream is reached.
public int read(b[] , int off, int len) throws IOException
Reads up tolen
bytes of data from the input stream into an array of bytes. An attempt is made to read as many aslen
bytes, but a smaller number may be read. The number of bytes actually read is returned as an integer. This method blocks until input data is available, end of file is detected, or an exception is thrown. Ifb
isnull
, aNullPointerException
is thrown. Ifoff
is negative, orlen
is negative, oroff+len
is greater than the length of the arrayb
, then anIndexOutOfBoundsException
is thrown. Iflen
is zero, then no bytes are read and0
is returned; otherwise, there is an attempt to read at least one byte. If no byte is available because the stream is at end of file, the value-1
is returned; otherwise, at least one byte is read and stored intob
. The first byte read is stored into elementb[off]
, the next one intob[off+1]
, and so on. The number of bytes read is, at most, equal tolen
. Let k be the number of bytes actually read; these bytes will be stored in elementsb[off]
throughb[off+
k-1]
, leaving elementsb[off+
k]
throughb[off+len-1]
unaffected. In every case, elementsb[0]
throughb[off]
and elementsb[off+len]
throughb[b.length-1]
are unaffected. If the first byte cannot be read for any reason other than end of file, then anIOException
is thrown. In particular, anIOException
is thrown if the input stream has been closed. Theread(b,
off,
len)
method for classInputStream
simply calls the methodread()
repeatedly. If the first such call results in anIOException
, that exception is returned from the call to theread(b,
off,
len)
method. If any subsequent call toread()
results in aIOException
, the exception is caught and treated as if it were end of file; the bytes read up to that point are stored intob
and the number of bytes read before the exception occurred is returned. Subclasses are encouraged to provide a more efficient implementation of this method.
- Parameters:
off
- the start offset in arrayb
at which the data is written.len
- the maximum number of bytes to read.
- Returns:
- the total number of bytes read into the buffer, or
-1
if there is no more data because the end of the stream has been reached.
- See Also:
java.io.InputStream.read()
public void reset() throws IOException
Repositions this stream to the position at the time themark
method was last called on this input stream. The general contract ofreset
is:
- If the method
markSupported
returnstrue
, then:- If the method
mark
has not been called since the stream was created, or the number of bytes read from the stream sincemark
was last called is larger than the argument tomark
at that last call, then anIOException
might be thrown.- If such an
IOException
is not thrown, then the stream is reset to a state such that all the bytes read since the most recent call tomark
(or since the start of the file, ifmark
has not been called) will be resupplied to subsequent callers of theread
method, followed by any bytes that otherwise would have been the next input data as of the time of the call toreset
.If the method markSupported
returnsfalse
, then:The method
- The call to
reset
may throw anIOException
.- If an
IOException
is not thrown, then the stream is reset to a fixed state that depends on the particular type of the input stream and how it was created. The bytes that will be supplied to subsequent callers of theread
method depend on the particular type of the input stream.reset
for classInputStream
does nothing except throw anIOException
.
- See Also:
java.io.InputStream.mark(int)
,java.io.IOException