Home » inputstream

Tag Archives: inputstream

java.io.FileInputStream – Java FileInputStream Example

Bipartite Graph

In this example, we are going to see how to use FileInputStream in Java and inputstream. FileInputStream in an InputStream subclass that is used to read data from files in a file system. It is actually connected to a specific file and can be used to extract data from them and make them available inside your program for manipulation. As ...

Read More »

How to copy a directory in Java

Bipartite Graph

In this tutorial we are going to see how you can copy a directory in Java. The idea is very simple. You open the directory and you list the contents. Then you open the contents and examine them one by one. If the entry you are looking at is a File, you can copy it to the new location. If ...

Read More »

How to Convert InputStream to String in Java

Bipartite Graph

In this tutorial we are going to show three different methods that you can use in order to read a file and convert it to String in Java. The way to read a file with Java is pretty straightforward, you use an FileInputStream. But sometimes you might want to perform several operations in that Stream, for example you might want ...

Read More »

Read char from console with InputStream

Bipartite Graph

This is an example of how to read a char from console using an InputStream. It is an abstract class that is the superclass of all classes representing an input stream of bytes. Applications that need to define a subclass of InputStream must always provide a method that returns the next byte of input. Reading a char implies that you ...

Read More »

Read line of chars from console with InputStream

Bipartite Graph

In this example we shall show you how to read a line of chars from console with an InputStream. This abstract class is the superclass of all classes representing an input stream of bytes. Applications that need to define a subclass of InputStream must always provide a method that returns the next byte of input. To read a line of ...

Read More »