Here you can find the source of readLine(DataInputStream dis)
Parameter | Description |
---|---|
dis | a parameter |
public static String readLine(DataInputStream dis)
//package com.java2s; //License from project: MIT License import java.io.DataInputStream; public class Main { /**// w ww . java 2s . c o m * Service routine * * @param dis * @return */ public static String readLine(DataInputStream dis) { String s = ""; byte ch = 0; try { while ((ch = dis.readByte()) != -1) { // System.out.println("ch = "+ch); if (ch == '\n') return s; s += (char) ch; } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return s; } }