protected String read ( SocketChannel sc ) throws IOException { sc . read ( buffer ) ; buffer . flip ( ) ; decoder . decode ( buffer , charBuffer , true ) ; charBuffer . flip ( ) ; String result = charBuffer . toString ( ) ; // Clear out buffers buffer . clear ( ) ; charBuffer . clear ( ) ; decoder . reset ( ) ; return result ; }
Reads a command or command response from a socket channel .