Concatenate & Buffer File in Java

Concatenate: It is possible to concatenate two or more files and save in a different file. In java, by using SequenceInputStream class we can concatenate two or more files. Buffer Files: In java, we can create a buffer to store temporary data that is read from & written to a stream and this process known … Read more

DataInputStream and DataOutputStream for primitive data

In java, basic input-output stream provides a method for reading & writing bytes or character in a file. If we want to read-write primitive data typa (such as int , float etc.) than we can use filter classes to filter data in the original stream. DataInputStream & DataOutputStream are two filter classes used for creating … Read more

Character Stream I/O in Java

In a java programming, like a Byte stream Character stream is also used for input-output for 16 bit. But Byte streams are used to perform input and output of 8-bit. Most common Character streams classes are, FileReader and FileWriter.  FileReader- FileReader uses for reads two bytes at a time.  FileWriter– FileWriter uses for writes two bytes at a … Read more

Byte Streams in Java

In java programming, to perform input and output of 8-bit, Byte stream is used. Most common byte streams classes are, FileInputStream and FileOutputStream. FileInputStream : FileInputStream is used for reads one byte at a time . FileOutputStream : FileOutputStream is used for writes one byte at a time Writing Bytes Example: Write a program, to write a bytes to … Read more

File and Input Output in Java

In Java programming, to perform the input-output in file handling  Java has a java.io package which contain contains nearly every class you might ever need. In file handling streams represent an input source and an output destination. Stream In java programming, a sequence of data defined as a “stream”. Simply  there are two type of … Read more

PHP Working with Directories

Handle a directory there are several functions in PHP language. i. mkdir() ii. opendir() iii. readdir() iv. scandir() v. rmdir() vi. closedir() i. Create Directory Want to create a new folder using PHP then use mkdir(). Only one argument is required the folder name or folder location where want to create the folder. Example

Read more

PHP File Handing

File handling is need for any web application so FILE HANDLING is an important part of PHP language. Some task to be done file needs to be processed. PHP have many function handling any kind of normal files. (Liketxt, docx, csv, jpg etc) Handle a file need to know below topics i. File create ii. … Read more

Displaying directory contents

For listing a directory content in java we use File class and use isDirectory() method to check whether it is directory or not. if directory then we use listFiles().

Displaying file properties

Checking whether a file or directory

Checking whether the File object exists if exists then check whether it is file of directory to check file existance exists() method of File class is used if it returns true means file or directory exists, at this point we are not confirm existing File object is file or directory. To check file object isDirectory() … Read more