Ejemplo n.º 1
0
 public void testGetRemainingOutputAsStream() throws IOException {
   LexerSource src = newSource("111111\n222222\n333333\n");
   for (int i = 0; i < 10; i++) {
     src.read();
   }
   final InputStream in = src.getRemainingAsStream();
   assertActionShouldProduce(
       "222\n333333\n",
       new Callable<byte[]>() {
         public byte[] call() throws Exception {
           ByteList buf = new ByteList();
           int c;
           while ((c = in.read()) != -1) {
             buf.append(c);
           }
           return buf.bytes();
         }
       });
 }