Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java I/O Streams (Data Stream (definition (binary I/O (primitive, String),…
Java I/O Streams
Data Stream
definition
binary I/O
primitive
String
specific method
for each datatype
ancestor
InputStream
(abstract)
DataInputStream
(class)
OutputStream
(abtract)
DataOutputStream
(class)
usage
DataStream( ByteStream)
Random Access Files
using pointers
array of bytes
Buffered Stream
definition
read/write from
buffer memory
access kernel when buffer is empty/full
ancestor
Reader
(abstract)
BufferedReader
(class)
Writer
(abstract)
BufferedWriter
(class)
PrintWriter
(class)
flush buffer every println/format
usage
BufferedReader(Char Stream)
Scanner
definition
breaks into tokens
then translate to datatypes
uses whitespace to separate tokens
.useDelimiter()
specify delimiter
usage
Scanner(BufferedStream(CharStream))
ancestor
Scanner
Object Stream
definition
binary I/O
serializable objects
primitives
transfer
initial object
reference objects
only transferred once
usage
ObjectStream( BufferedStream (CharStream))
ancestor
InputStream
(abstract)
ObjectInputStream
(class)
OutputStream
(abstract)
ObjectOutputStream
(class)
Byte Streams
definition
used for
most primitive I/O
close streams
avoid resource leaks
8 bits transfer
ancestor
InputStream
(abstract)
FileInputStream
(class)
OutputStream
(abstract)
FileOutputStream
(class)
Character Stream
definition
wrapper for
bytestreams
uses bytestream for physical I/O
then translates byte to char
ancestor
Reader
(abstract)
FileReader
(class)
Writer
(abstract)
FileWriter
(class)
.
Formatting
ancestor
PrintWriter - char
PrintStream - byte
System.err
System.out
methods
.println()
.print()
.format()
Cmd Line I/O
Console
Standard Stream
.out, .err, .in
streams
sequence of data being moved
java.io