Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

BufferedInputStream

try {
    // create a reader
    FileInputStream fis = new FileInputStream(new File("input.dat"));
    BufferedInputStream reader = new BufferedInputStream(fis);

    // read one byte at a time
    int ch;
    while ((ch = reader.read()) != -1) {
        System.out.print((char) ch);
    }

    // close the reader
    reader.close();

} catch (IOException ex) {
    ex.printStackTrace();
}
Source by attacomsian.com #
 
PREVIOUS NEXT
Tagged: #BufferedInputStream
ADD COMMENT
Topic
Name
5+6 =