Home » Archives for Nikos Maravitsas » Page 3

Author Archives: Nikos Maravitsas

Nikos has graduated from the Department of Informatics and Telecommunications of The National and Kapodistrian University of Athens. During his studies he discovered his interests about software development and he has successfully completed numerous assignments in a variety of fields. Currently, his main interests are system’s security, parallel systems, artificial intelligence, operating systems, system programming, telecommunications, web applications, human – machine interaction and mobile development.

Java BufferedReader Example

In this example we are going to talk about BufferedReader Java class. BufferedReader is a subclass of Reader class. As you might know, Reader is a utility class for reading character streams. Such a stream could be obtained from a text file, from the console , from a socket, from a pipe , from a database or even from a ...

Read More »

FileReader Java Example

In this example, we are going to see how to use FileReader Java class in order to read characters from a file. As you might remember from a previous FileInpustream Example it is easy to wrap an InputStream, that creates an input byte stream, to a Reader class that bridges a byte stream to a character stream. To be more ...

Read More »

java.io.FileOutputStream Example

In this example we are going to talk about FileOutputStream. FileOutputStream is a subclass of OutputStream, which is used to transfer data from your program to a resource. And in this case to a file that resides in your underlying file system. OK, so let’s start with some simple examples.             1. Writing bytes to ...

Read More »

java.io.OutputStream Example

In this example we are going to talk about OutputStream class in Java. OutputStream is an abstract class that enables you to write data to an output sink or destination. As with InputStream, that destination could be a console, a file, a socket, a pipe and even a buffer in memory. The most basic and fundamental thing you can do ...

Read More »

java.io.FileInputStream – Java FileInputStream Example

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 »

java.io.InputStream – InputStream Java Example

In this example, we are going to talk about a very important Java class, InputStream. If you have even the slightest experience with programming in Java, chances are that you’ve already used InputStream in one of your programs, or one of its subclasses, like FileInputStream or BufferedInputStream. You see, java io inputstream is an abstract class, that provides all the ...

Read More »

Java ZIP File Example

In this tutorial we are going to see how to ZIP a file in Java. ZIP is an archive file format that enables data compression and it is mostly used on files and folders. A ZIP file may contain one or more compressed files or folders. Many compression algorithms have been used by several ZIP implementations, which are ubiquitous in ...

Read More »

Java write to File Example

In this post, we feature a comprehensive example of how to write to File in Java using FileWriter, FileOutputStream, and NIO. We are going to investigate several methods to write a File in Java. We will list some of the older, before Java 7 and NIO, methods to write to a text or a binary file as well as some ...

Read More »

Java StringWriter Example

In this example we are going to see how to use StringWriter. StringWriter is a subclass of java.io.Writer and can be used to write character streams in a String buffer and later can be used to obtain the stream as a String and even obtain the output buffer as a StringBuffer. Let’s see some examples.           ...

Read More »

Java reverse String Example

In this example, we are going to see how to reverse a String in Java. We are going to see how to this, very conveniently using a StringBuffer, and two other solutions using recursion and simply using a character array. Let’s see the examples. 1. Reversing a String using StringBuffer Let’s see how you can use a StringBuffer to reverse ...

Read More »