GZipIdentificationRequest implements IdentificationRequest<InputStream> { @Override public byte getByte(long position) throws IOException { final int result = reader.readByte(position); if (result < 0) { throw new IOException("No byte at position " + position); } return (byte) result; } GZipIdentificationRequest(final RequestMetaData metaData, final RequestIdentifier identifier,
                                     final Path tempDir); @Override final void open(InputStream in); @Override final void close(); @Override final String getExtension(); @Override final String getFileName(); @Override final long size(); @Override final InputStream getSourceInputStream(); @Override final RequestMetaData getRequestMetaData(); @Override final RequestIdentifier getIdentifier(); @Override byte getByte(long position); @Override WindowReader getWindowReader();  }
@Test public void testGetByte3FollowedByByte42() throws IOException { assertEquals(fileData.getBytes()[3], gzRequest.getByte(3)); assertEquals(fileData.getBytes()[42], gzRequest.getByte(42)); }
@Test public void testGetByte42FollowedByByte3() throws IOException { assertEquals(fileData.getBytes()[42], gzRequest.getByte(42)); assertEquals(fileData.getBytes()[3], gzRequest.getByte(3)); }
@Test public void testGetByte42FollowedByByteMillion() throws IOException { assertEquals(fileData.getBytes()[42], gzRequest.getByte(42)); try { gzRequest.getByte(1000000L); fail("Expected IOException."); } catch (IOException e) { } }