| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
InputStreamnet.sf.saxon.dotnet.DotNetInputStreampublic class DotNetInputStreamextends InputStreamConstructor Summary | |
| |
Method Summary | |
void |
|
Stream |
|
void |
|
boolean |
|
int |
|
int |
|
void |
|
public void close()
throws IOExceptionCloses this output stream and releases any system resources associated with this stream. The general contract ofcloseis that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened. Theclosemethod ofOutputStreamdoes 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 theresetmethod repositions this stream at the last marked position so that subsequent reads re-read the same bytes. Thereadlimitarguments tells this input stream to allow that many bytes to be read before the mark position gets invalidated. The general contract ofmarkis that, if the methodmarkSupportedreturnstrue, the stream somehow remembers all the bytes read after the call tomarkand stands ready to supply those same bytes again if and whenever the methodresetis called. However, the stream is not required to remember any data at all if more thanreadlimitbytes are read from the stream beforeresetis called. Themarkmethod ofInputStreamdoes 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 themarkandresetmethods. Whether or notmarkandresetare supported is an invariant property of a particular input stream instance.
- Returns:
trueif this stream instance supports the mark and reset methods;falseotherwise.
- See Also:
java.io.InputStream.mark(int),java.io.InputStream.reset()
public int read()
throws IOExceptionReads the next byte of data from the input stream. The value byte is returned as anintin the range0to255. If no byte is available because the end of the stream has been reached, the value-1is 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
-1if the end of the stream is reached.
public int read(b[] ,
int off,
int len)
throws IOExceptionReads up tolenbytes of data from the input stream into an array of bytes. An attempt is made to read as many aslenbytes, 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. Ifbisnull, aNullPointerExceptionis thrown. Ifoffis negative, orlenis negative, oroff+lenis greater than the length of the arrayb, then anIndexOutOfBoundsExceptionis thrown. Iflenis zero, then no bytes are read and0is 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-1is 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 anIOExceptionis thrown. In particular, anIOExceptionis thrown if the input stream has been closed. Theread(b,off,len)method for classInputStreamsimply 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 intoband 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 arraybat which the data is written.len- the maximum number of bytes to read.
- Returns:
- the total number of bytes read into the buffer, or
-1if there is no more data because the end of the stream has been reached.
- See Also:
java.io.InputStream.read()
public void reset()
throws IOExceptionRepositions this stream to the position at the time themarkmethod was last called on this input stream. The general contract ofresetis:
- If the method
markSupportedreturnstrue, then:- If the method
markhas not been called since the stream was created, or the number of bytes read from the stream sincemarkwas last called is larger than the argument tomarkat that last call, then anIOExceptionmight be thrown.- If such an
IOExceptionis 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, ifmarkhas not been called) will be resupplied to subsequent callers of thereadmethod, followed by any bytes that otherwise would have been the next input data as of the time of the call toreset.If the method markSupportedreturnsfalse, then:The method
- The call to
resetmay throw anIOException.- If an
IOExceptionis 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 thereadmethod depend on the particular type of the input stream.resetfor classInputStreamdoes nothing except throw anIOException.
- See Also:
java.io.InputStream.mark(int),java.io.IOException