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