img
Method
Description
int available( )
Returns the number of bytes of input currently available for
reading.
void close( )
Closes the input source. Fur ther read attempts will generate
an IOException.
void mark(int numBytes)
Places a mark at the current point in the input stream that will
remain valid until numBytes bytes are read.
boolean markSuppor ted( )
Returns true if mark( )/reset( ) are suppor ted by the invoking
stream.
int read( )
Returns an integer representation of the next available byte of
input. ­1 is returned when the end of the file is encountered.
int read(byte buf fer[ ])
Attempts to read up to buf fer.length bytes into buf fer and
returns the actual number of bytes that were successfully
read. ­1 is returned when the end of the file is encountered.
int read(byte buf fer[ ], int of fset, Attempts to read up to numBytes bytes into buf fer star ting at
int numBytes)
buf fer[of fset], returning the number of bytes successfully
read. ­1 is returned when the end of the file is encountered.
void reset( )
Resets the input pointer to the previously set mark.
long skip(long numBytes)
Ignores (that is, skips) numBytes bytes of input, returning the
number of bytes actually ignored.
TABLE 19-1
The Methods Defined by InputStream
NOTE  Most of the methods described in Tables 19-1 and 19-2 are implemented by the subclasses of
OTE
InputStream and OutputStream. The mark( ) and reset( ) methods are exceptions; notice their
use or lack thereof by each subclass in the discussions that follow.
Method
Description
void close( )
Closes the output stream. Fur ther write attempts will
generate an IOException.
void flush( )
Finalizes the output state so that any buf fers are cleared.
That is, it flushes the output buf fers.
void write(int b)
Writes a single byte to an output stream. Note that the
parameter is an int, which allows you to call write( ) with
expressions without having to cast them back to byte.
void write(byte buf fer[ ])
Writes a complete array of bytes to an output stream.
void write(byte buf fer[ ], int of fset, Writes a subrange of numBytes bytes from the array buf fer,
int numBytes)
beginning at buf fer[of fset].
TABLE 19-2
The Methods Defined by OutputStream
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home