Input and Output in Java
Input and Output in Java
Byte- and Character-based I/O File Objects
jonas.kvarnstrom@liu.se ? 2016
Introduction
Two forms of I/O:
2
Discussed in this lecture
See RandomAccess
File
jonkv@ida
jonkv@ida
Streams 1: The Concept
3
Sequential access: Provided by a stream
In nature: Water
In industry, "discretized": A conveyor belt
A sequence of elements Arriving one at a time
Used in most of Java's I/O classes
jonkv@ida
Streams 2: Input
4
Elements can be bytes
Can come from a file on disk, but also:
A network connection ? a natural stream, can't jump back/forward An array of bytes ? already in memory, but someone wants a stream from us! ...
source
Our code, reading
jonkv@ida
Streams 3: Sources
5
Java streams:
One abstract "general input stream"
abstract class InputStream
One concret subclass for each source
InputStream is1 = new FileInputStream("info.dat");
InputStream is2 = new ByteArrayInputStream(myArray); InputStream is3 = socket.getInputStream();
...
InputStream
FileInputStream
SocketInputStream ByteArrayInputStream
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- cse 2231 java input output
- input and output in java
- programming languages cse 413 autumn 2002 java input
- input and output
- output streams unibz
- input and output pcc
- topic 18 file input tokens
- java files copyright © tutorialspoint
- chapter 3 introduction to objects and input output
- java input output core web programming
Related searches
- input and output calculator
- input and output table calculator
- java input and output stream
- java input and output file
- input and output equations
- input and output function math
- input and output math solver
- input and output equation
- input and output in math
- input and output equation calculator
- input and output tables
- input and output in java