3:11 pm - Saturday November 23, 2571

FileInputStream example program for available() in java

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
 * @author : candidjava
 * task : FileInputStream example program for available() in java
 */

import java.io.FileInputStream;

class FIStream {
	public static void main(String[] args) {
		try {
			FileInputStream fi = new FileInputStream("sample.txt");// content:Hello(file
			// created
			// inside
			// project
			// directory)
			int a = fi.available();
			System.out.println(a);
			fi.close();
		} catch (Exception e) {
			System.out.println(e);
		}
	}
}

 

Output

5

 

BACK

Filed in: Z-A All Java Codes

Comments are closed.