private void readData ( ) throws IOException { while ( ! isClosed ) { int code = is . read ( ) ; switch ( code ) { case ' ' : case ' ' : case ' ' : case ' ' : break ; case ' ' : { int channel = ( is . read ( ) << 8 ) + is . read ( ) ; inputReady [ channel ] = true ; return ; } case ' ' : { int channel = ( is . read ( ) << 8 ) + is . read ( ) ; int status = ( is . read ( ) << 8 ) + is . read ( ) ; inputReady [ channel ] = true ; return ; } case - 1 : close ( ) ; return ; default : // An error in the protocol. Kill the connection. close ( ) ; return ; } } return ; }
Reads data until a channel packet C or error E is received .