Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +--------------------------------------------------------+---------------------------------------------------------------+
- | IO | NIO(New IO) |
- +--------------------------------------------------------+---------------------------------------------------------------+
- | Stream oriented (no cache) | Channels/Buffers oriented (with cache) |
- | Thread Blocking IO(Synchronous) | Non Thread blocking IO(Asynchronous i.e notification based) |
- | read and write can do one byte/char at a time. | Channel can read and write byte buffer(not char buffer). |
- | readers are for read only, writers are for write only. | Channel can read multiple byte at a time. |
- | Buffer creates in JVM heap memory. | Buffer can be outside or in-memory of JVM. |
- | Charset is limited ot UTF-8. | Charset support expanded to UTF-16 and more. |
- +--------------------------------------------------------+---------------------------------------------------------------+
- +==+==================+======================+=======================+===================+====================+
- | | Byte Based | Character Based |
- | Context | Input | Output | Input | Output |
- +==================+======================+=======================+===================+====================+
- | Basic | InputStream | OutputStream | Reader | Writer |
- | | | | InputStreamReader | OutputStreamWriter |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Arrays | ByteArrayInputStream | ByteArrayOutputStream | CharArrayReader | CharArrayWriter |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Files | FileInputStream | FileOutputStream | FileReader | FileWriter |
- | | RandomAccessFile | RandomAccessFile | | |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Pipes | PipedInputStream | PipedOutputStream | PipedReader | PipedWriter |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Buffering | BufferedInputStream | BufferedOutputStream | BufferedReader | BufferedWriter |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Filtering | FilterInputStream | FilterOutputStream | FilterReader | FilterWriter |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Parsing | PushbackInputStream | | PushbackReader | |
- | | StreamTokenizer | | LineNumberReader | |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Strings | | | StringReader | StringWriter |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Data | DataInputStream | DataOutputStream | | |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Data - Formatted | | PrintStream | | PrintWriter |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Objects | ObjectInputStream | ObjectOutputStream | | |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
- | Utilities | SequenceInputStream | | | |
- +------------------+----------------------+-----------------------+-------------------+--------------------+
Add Comment
Please, Sign In to add comment