1 package org.apache.lucene.index; 2 3 18 19 import junit.framework.TestCase; 20 import org.apache.lucene.store.InputStream; 21 22 import java.io.IOException ; 23 24 public class TestInputStream extends TestCase { 25 public void testRead() throws IOException { 26 InputStream is = new MockInputStream(new byte[] { (byte) 0x80, 0x01, 27 (byte) 0xFF, 0x7F, 28 (byte) 0x80, (byte) 0x80, 0x01, 29 (byte) 0x81, (byte) 0x80, 0x01, 30 0x06, 'L', 'u', 'c', 'e', 'n', 'e'}); 31 assertEquals(128,is.readVInt()); 32 assertEquals(16383,is.readVInt()); 33 assertEquals(16384,is.readVInt()); 34 assertEquals(16385,is.readVInt()); 35 assertEquals("Lucene",is.readString()); 36 } 37 } 38 | Popular Tags |