Section
11 : The java.io Package
Miscellaneous
The hierarchy of I/O
package is like this:
InputStream
-
ByteArrayInputStream
-
FileInputStream
-
PipedInputStream
-
FilterInputStream
-
BufferedInputStream
-
PushbackInputStream
-
DataInputStream
-
ObjectInputStream
OutputStream
-
ByteArrayOutputStream
-
FileOutputStream
-
PipedOutputStream
-
FilterOutputStream
-
BufferedOutputStream
-
PrintStream
-
DataOutputStream
-
ObjectOutputStream
Reader
-
BufferedReader
-
CharArrayReader
-
FilterReader
-
PushbackReader
-
FileReader
-
InputStreamReader
-
PipedReader
-
StringReader
Writer
-
BufferedWriter
-
CharArrayWriter
-
FilterWriter
-
OutputStreamWriter
-
PipedWriter
-
PrintWriter
-
StringWriter
-
Some methods of
InputStream:
-
int
available()
-
void close ()
-
void mark(
int readLimit)
-
boolean markSupported
()
-
abstract
int read ()
-
int read (byte [] bytes)
-
int read (byte [] bytes,
int offset,
int length)
-
void reset ()
-
long skip (long n)
Some methods of
OutputStream:
-
void close ()
-
void flush ()
-
void write (byte [] b)
-
void write (byte [] b,
int offset, int length)
-
abstract
void write (int b)
Some methods of Reader:
-
void close ()
-
void mark (int
readLimit)
-
boolean markSupported
()
-
int read ()
-
int read
(char [] chars)
-
abstract int read (char
[] chars, int offset, int length)
-
boolean ready ()
-
void reset ()
-
long skip
(long n)
Some methods of Writer:
-
abstract
void close ()
-
abstract
void flush ()
-
void write (char []
chars)
-
abstract
void write (char []
chars, int offset, int length)
-
void write (int c)
-
void write (String s)
-
void write (String s,
int offset, int length)
Methods that do not throw
IOException:
InputStream:
File:
-
All
Constructors
-
getCanonicalFile ()
-
getCanonicalPath ()
-
createNewFile ()
-
toURL ()
-
createTempFile ()
OutputStreamWriter:
FileInputStream
and FileOutputStream:
RandomAccessFile:
Reader and Writer:
PrintStream and
PrintWriter:
FileReader:
All constructors throw
FileNotFoundException except fdObj version.
FileWriter:
One constructor (fdObj
version)
BufferedReader and
BufferedWriter:
-
All the
constructors.
-
markSupported()
BufferedInputStream
and BufferedOutputStream:
section11-1 | section11-2 | section11-3 | section11-4 | section11-5 | section11-6
Sections :
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11
|