package javabeat.net.io;
import java.io.BufferedInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
/**
* Java getResourceAsStream() Example
*
* @author Krishna
*
*/
public class GetResourceAsStreamExample {
public static void main(String[] args) throws IOException,
FileNotFoundException {
Class classVar = GetResourceAsStreamExample.class;
//Loading the file from the current classloaders classpath
BufferedInputStream fileInputStream = (BufferedInputStream) classVar
.getClassLoader().getResourceAsStream("resources.properties");
int i = fileInputStream.read();
while (i != -1) {
System.out.println((char) i);
i = fileInputStream.read();
}
}
}