Java examples for java.io:InputStream Read
Read Ascii String from InputStream
//package com.java2s; import java.io.IOException; import java.io.InputStream; public class Main { static char[] textbuffer = new char[1000]; public static String ReadAsciiString(InputStream is) throws IOException { int current; int index = 0; while ((current = is.read()) != 0) { textbuffer[index++] = (char) current; }/* ww w . j a v a2 s .co m*/ return new String(textbuffer, 0, index); } }