/** Load the created list in a DirectoryDiff */ private List<INode> loadCreatedList(InputStream in, INodeDirectory dir, int size) throws IOException { List<INode> clist = new ArrayList<INode>(size); for (long c = 0; c < size; c++) { CreatedListEntry entry = CreatedListEntry.parseDelimitedFrom(in); INode created = SnapshotFSImageFormat.loadCreated(entry.getName() .toByteArray(), dir); clist.add(created); } return clist; }
private void saveCreatedList(List<INode> created, OutputStream out) throws IOException { // local names of the created list member for (INode c : created) { SnapshotDiffSection.CreatedListEntry.newBuilder() .setName(ByteString.copyFrom(c.getLocalNameBytes())).build() .writeDelimitedTo(out); } }