Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.dpunkt.streams.standard;
- import java.io.IOException;
- public class StreamDemo {
- public static void main(String args[]) {
- byte buffer[] = new byte[80]; // Zeichenpuffer
- String input = "";
- int read;
- do {
- try {
- // Einlesen der Zeichen
- read = System.in.read(buffer, 0, 80);
- // Umwandeln des Pufferinhaltes in einen String
- input = new String(buffer, 0, read);
- // Ausgabe der eingelesenen Zeichen
- System.out.print(input);
- }
- catch(IOException e) {
- e.printStackTrace();
- }
- } while(! input.equals("exit"+System.getProperty("line.separator")));
- System.out.println(
- "Thank you very much for using this program");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement