OnJava8-Examples/io/FormattedMemoryInput.java

20 lines
555 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: io/FormattedMemoryInput.java
2015-05-29 14:18:51 -07:00
// <20>2015 MindView LLC: see Copyright.txt
2015-04-20 15:36:01 -07:00
import java.io.*;
public class FormattedMemoryInput {
public static void main(String[] args)
throws IOException {
try {
DataInputStream in = new DataInputStream(
new ByteArrayInputStream(
BufferedInputFile.read(
"FormattedMemoryInput.java").getBytes()));
while(true)
System.out.write((char)in.readByte());
2015-04-20 15:36:01 -07:00
} catch(EOFException e) {
2015-05-30 19:07:15 -07:00
System.out.println("End of stream");
2015-04-20 15:36:01 -07:00
}
}
2015-05-05 11:20:13 -07:00
} /* (Execute to see output) *///:~