### Question:
BlockDirectory extends Directory { public long fileLength(String name) throws IOException { return _directory.fileLength(name); } BlockDirectory(String dirName, Directory directory);  BlockDirectory(String dirName, Directory directory, Cache cache);  BlockDirectory(String dirName, Directory directory, Cache cache, Set<String> blockCacheFileTypes); static long getBlock(long pos); static long getPosition(long pos); static long getRealPosition(long block, long positionInBlock); IndexInput openInput(String name, int bufferSize); @Override IndexInput openInput(final String name); @Override void close(); void clearLock(String name); void copy(Directory to, String src, String dest); LockFactory getLockFactory(); String getLockID(); Lock makeLock(String name); void setLockFactory(LockFactory lockFactory); void sync(Collection<String> names); @SuppressWarnings("deprecation") void sync(String name); String toString(); IndexOutput createOutput(String name); void deleteFile(String name); boolean fileExists(String name); long fileLength(String name); @SuppressWarnings("deprecation") long fileModified(String name); String[] listAll(); @SuppressWarnings("deprecation") void touchFile(String name); static final long BLOCK_SHIFT; static final long BLOCK_MOD; static final int BLOCK_SIZE; static Cache NO_CACHE; }### Answer:
@Test public void testEOF() throws IOException { Directory fsDir = FSDirectory.open(new File(file, "normal")); String name = "test.eof"; createFile(name, fsDir, directory); long fsLength = fsDir.fileLength(name); long hdfsLength = directory.fileLength(name); assertEquals(fsLength, hdfsLength); testEof(name, fsDir, fsLength); testEof(name, directory, hdfsLength); }