Code example for PushbackInputStream

0
 
		public void run() { 
			Log.i("Hugedata:TcpServerService", "Accepted connection from"
					+ socket.getInetAddress() + ":" + socket.getPort());
			try { 
				inStream = new PushbackInputStream(socket.getInputStream());
				head = StreamTool.readLine(inStream);
			} catch (IOException e) {
				// TODO Auto-generated catch block 
				e.printStackTrace();
			} 
			Log.i("Hugedata:TcpServerService", "head:" + head);
 
			if (head.trim().equals("handshake"))
				handShake(); 
			if (head.trim().equals("task"))
				taskReceive(); 
		}// run 
 
		public void handShake() {