void readFully(ByteBuffer data) throws IOException {
  while (data.hasRemaining()) {
    input.read(data);
  }
}

void readFully ( ByteBuffer data ) throws IOException { while ( data . hasRemaining ( ) ) { input . read ( data ) ; } }
read from channel until data buffer is full .
