/** Ensure that the character buffer is sufficiently full */ public void fill(int amount) throws CharStreamException { try { syncConsume(); // Fill the buffer sufficiently to hold needed characters while (queue.nbrEntries < amount + markerOffset) { // Append the next character queue.append((char)input.read()); } } catch (IOException io) { throw new CharStreamIOException(io); } } }