private void fillScratchBuffer(int bytesToRead) throws IOException {
  assert (bytesToRead <= scratchBuffer.capacity());
  scratchBuffer.clear();
  scratchBuffer.limit(bytesToRead);
  read(scratchBuffer);
  scratchBuffer.flip();
}

private void fillScratchBuffer ( int bytesToRead ) throws IOException { assert ( bytesToRead <= scratchBuffer . capacity ( ) ) ; scratchBuffer . clear ( ) ; scratchBuffer . limit ( bytesToRead ) ; read ( scratchBuffer ) ; scratchBuffer . flip ( ) ; }
fills the scratch buffet with data from the main buffer . if there is not enough data in the buffer more data will be read from the channel .
