### Question:
ViewFsFileStatus extends FileStatus { @Override public long getLen() { return myFs.getLen(); } ViewFsFileStatus(FileStatus fs, Path newPath); @Override boolean equals(Object o); int hashCode(); @Override long getLen(); @Override boolean isFile(); @Override boolean isDirectory(); @Override @SuppressWarnings("deprecation") boolean isDir(); @Override boolean isSymlink(); @Override long getBlockSize(); @Override short getReplication(); @Override long getModificationTime(); @Override long getAccessTime(); @Override FsPermission getPermission(); @Override String getOwner(); @Override String getGroup(); @Override Path getPath(); @Override void setPath(final Path p); @Override Path getSymlink();  }### Answer:
@Test public void testFileStatusSerialziation() throws IOException, URISyntaxException { String testfilename = "testFileStatusSerialziation"; TEST_DIR.mkdirs(); File infile = new File(TEST_DIR, testfilename); final byte[] content = "dingos".getBytes(); FileOutputStream fos = null; try { fos = new FileOutputStream(infile); fos.write(content); } finally { if (fos != null) { fos.close(); } } assertEquals((long)content.length, infile.length()); Configuration conf = new Configuration(); ConfigUtil.addLink(conf, "/foo/bar/baz", TEST_DIR.toURI()); FileSystem vfs = FileSystem.get(FsConstants.VIEWFS_URI, conf); assertEquals(ViewFileSystem.class, vfs.getClass()); FileStatus stat = vfs.getFileStatus(new Path("/foo/bar/baz", testfilename)); assertEquals(content.length, stat.getLen()); DataOutputBuffer dob = new DataOutputBuffer(); stat.write(dob); DataInputBuffer dib = new DataInputBuffer(); dib.reset(dob.getData(), 0, dob.getLength()); FileStatus deSer = new FileStatus(); deSer.readFields(dib); assertEquals(content.length, deSer.getLen()); }