TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Java Tutorials

Java IO Streams

Overview

In this tutorial, we will learn Java IO Streams. A stream is a flow of data from the data source to the data destination. A stream is a logical connection between two areas/resources. The data is read from the data source and written to the data destination.

IO Streams

Streams can be divided into two main types Byte streams and Character streams. All the stream classes are defined in the java.io package. We need to import from this package the classes whenever we use stream classes in the Java program.

 

Java IO Streams

Byte Stream

Byte streams use plain bytes like in ASCII (8-bit) format and are mostly suited for standalone Java applications. Byte streams can be done using two classes:

  • InputStream
  • OutputStream

When the data is read ( the flow is towards the Java program) it is called InputStream. The InputSream is an abstract superclass of all classes representing an input stream of bytes.

Java InputStream

 

When the data is stored or written (flow is outwards or away from the Java program) it is called OutputStream. The OutputStream is an abstract superclass of all classes representing an output stream of bytes.

Java OutputStream

Both InputStream and OutputStream classes are abstract and cannot be instantiated. The System class defines three stream objects for communication with standard I/O devices.

https://www.testingdocs.com/keyboard-interaction-in-java/

Character Stream

Character streams are the flow of characters for example Unicode (UTF-16/ 16-bit encoding) format. Character streams can be done using two classes:

  • Reader
  • Writer

Character streams are suitable for standalone as well as in web applications.

—

Java Tutorials

Java Tutorial on this website:

https://www.testingdocs.com/java-tutorial/

For more information on Java, visit the official website :

https://www.oracle.com/java/

Related Posts

Download Greenfoot Windows

Java Tutorials /

Download & Install Greenfoot on Windows

Java Tutorials /

Java Static Code Analysis

Java Tutorials /

Java Testing Tools

Java Tutorials /

Handle Multiple Exceptions in Java

Exceptions_In_Java

Java Tutorials /

Exceptions in Java Programs

‹ Java static methods› Keyboard Interaction in Java

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com