1 package antlr; 2 3 9 10 22 24 import java.io.InputStream ; 25 import java.io.IOException ; 26 27 public class ByteBuffer extends InputBuffer { 28 29 transient InputStream input; 31 32 33 34 public ByteBuffer(InputStream input_) { 35 super(); 36 input = input_; 37 } 38 39 40 public void fill(int amount) throws CharStreamException { 41 try { 42 syncConsume(); 43 while (queue.nbrEntries < amount + markerOffset) { 45 queue.append((char)input.read()); 47 } 48 } 49 catch (IOException io) { 50 throw new CharStreamIOException(io); 51 } 52 } 53 } 54 | Popular Tags |