CeosFileReader { public void seek(final long pos) throws IOException { stream.seek(pos); } CeosFileReader(final ImageInputStream stream); void close(); void seek(final long pos); void skipBytes(final long numBytes); int readB1(); short readB2(); int readB4(); long readB8(); void readB4(final int[] array); void readB8(final long[] array); int readI4(); long readIn(final int n); void readB1(final byte[] array); double readFn(final int n); double readEn(final int n); double readGn(final int n); void readGn(final int n, final double[] numbers); String readAn(final int n); int[] readInArray(final int arraySize, final int intValLength); long getCurrentPos();  }
@Test public void testSeek() throws IOException, IllegalCeosFormatException { final byte[] bytes = new byte[]{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; _ios.write(bytes); final CeosFileReader ceosReader = new CeosFileReader(_ios); ceosReader.seek(1); assertEquals(1, ceosReader.readB1()); ceosReader.seek(3); assertEquals(3, ceosReader.readB1()); ceosReader.seek(9); assertEquals(9, ceosReader.readB1()); ceosReader.seek(4); assertEquals(4, ceosReader.readB1()); ceosReader.seek(14); assertEquals(14, ceosReader.readB1()); }