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