List of utility methods to do DataInputStream Read Line
String | readLine(DataInputStream dis) Service routine String s = ""; byte ch = 0; try { while ((ch = dis.readByte()) != -1) { if (ch == '\n') return s; s += (char) ch; } catch (Exception e) { e.printStackTrace(); return s; |
String | readLine(DataInputStream ds) read a line from InputStreamReader, it will block until a '\n' is read. StringBuffer sb = new StringBuffer(); int c = ds.readByte(); while (c != '\n' && c != -1) { sb.append((char) c); c = ds.readByte(); return sb.toString(); |
String | readLine(DataInputStream in) read Line String s = ""; while (true) { int b = in.read(); if (b == '\n') return s; else s += (char) b; |