Sunday 10 March 2013

ready()


ready()

Declaration:
public boolean ready()
throws IOException
Description:
Tell whether this stream is ready to be read.
Returns: True if the next read() is guaranteed not to block for input, false otherwise. Note that returning
false does not guarantee that the next read will block.
Throws:
IOException - If an I/O error occurs
markSupported()
Declaration:
public boolean markSupported()
Description:
Tell whether this stream supports the mark() operation. The default implementation always returns false.
Subclasses should override this method.
Returns: true if and only if this stream supports the mark operation.
mark(int)
Declaration:
public void mark(int readAheadLimit)
throws IOException
Description:
Mark the present position in the stream. Subsequent calls to reset() will attempt to reposition the stream to
this point. Not all character-input streams support the mark() operation.
Parameters:
readAheadLimit - Limit on the number of characters that may be read while still preserving the
mark. After reading this many characters, attempting to reset the stream may fail.
Throws:
IOException - If the stream does not support mark(), or if some other I/O error occurs
reset()
Declaration:
public void reset()
throws IOException
Description:
Reset the stream. If the stream has been marked, then attempt to reposition it at the mark. If the stream has
not been marked, then attempt to reset it in some way appropriate to the particular stream, for example by
repositioning it to its starting point. Not all character-input streams support the reset() operation, and some
support reset() without supporting mark().

Throws:
IOException - If the stream has not been marked, or if the mark has been invalidated, or if the
stream does not support reset(), or if some other I/O error occurs
close()
Declaration:
public abstract void close()
throws IOException
Description:
Close the stream. Once a stream has been closed, further read(), ready(), mark(), or reset() invocations will
throw an IOException. Closing a previously-closed stream, however, has no effect.
Throws:
IOException - If an I/O error occurs


No comments:

Post a Comment