private static void readFilename(FileSystem fileSystem, String file, byte[] cmp) throws TestFailedException {
		FileHandle handle;
		try {
			handle = fileSystem.openFile(file, true, true);
		} catch (PathNotFoundException e) {
			throw new TestFailedException(e);
		} catch (AccessDeniedException e) {
			throw new TestFailedException("You have claimed that the file system is not read only", e);
		} catch (NotAFileException e) {
			throw new TestFailedException(file + " should be a file", e);
		}
		
		byte[] testBuffer = new byte[cmp.length];
		ByteBuffer buf = ByteBuffer.wrap(testBuffer);
		int read = fileSystem.read(handle, buf, 0);
		if (read != cmp.length)
			throw new TestFailedException("Reading of " + file + " at position 0 failed. Should read " + cmp.length + " bytes, actual: " + read);
		
		try {
			byteArrayCompare(cmp, testBuffer);
		} catch (IOException e) {
			throw new TestFailedException("Reading of " + file + " at position 0 failed", e);
		}
		byte[] testBuffer2 = new byte[cmp.length - 4];
		ByteBuffer buffer2 = ByteBuffer.wrap(testBuffer2);
		read = fileSystem.read(handle, buffer2, 4);
		if (read != cmp.length - 4)
			throw new TestFailedException("Reading of " + file + " at position 0 failed. Should read " + (cmp.length - 4) + " bytes, actual: " + read);
		byte[] cmp2 = new byte[cmp.length - 4];
		System.arraycopy(cmp, 4, cmp2, 0, cmp2.length);
		try {
			byteArrayCompare(cmp2, testBuffer2);
		} catch (IOException e) {
			throw new TestFailedException("Reading of " + file + " at position 4 failed", e);
		}
		try
		{
			fileSystem.close(handle);
		} catch (DriveFullException e) {
			throw new TestFailedException(e);
		}
	}