/** * Write any changes which have been made to POIFSFileSystem, * to the underlying ByteBuffer. This is necessary if the changes * are to be persisted. * * @throws IOException */ public void writePOIFSFileSystem() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); getFs().writeFilesystem(baos); // Need to put this is bb byte[] bytes = baos.toByteArray(); // java.nio.ByteBuffer bb contains the data setBinaryData( ByteBuffer.wrap(bytes) ); }
/** * @param os * @param verbose * @throws IOException * @since 3.0.0 */ public void viewFile(OutputStream os, boolean verbose) throws IOException { String indent=""; boolean withSizes = true; displayDirectory(getFs().getRoot(), os, indent, withSizes); if (verbose) { List strings = POIFSViewEngine.inspectViewable(fs, true, 0, " "); Iterator iter = strings.iterator(); while (iter.hasNext()) { os.write( ((String)iter.next()).getBytes()); } } }
/** * Write any changes which have been made to POIFSFileSystem, * to the underlying ByteBuffer. This is necessary if the changes * are to be persisted. * * @throws IOException */ public void writePOIFSFileSystem() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); getFs().writeFilesystem(baos); // Need to put this is bb byte[] bytes = baos.toByteArray(); // java.nio.ByteBuffer bb contains the data setBinaryData( ByteBuffer.wrap(bytes) ); }
/** * @param os * @param verbose * @throws IOException * @since 3.0.0 */ public void viewFile(OutputStream os, boolean verbose) throws IOException { String indent=""; boolean withSizes = true; displayDirectory(getFs().getRoot(), os, indent, withSizes); if (verbose) { List strings = POIFSViewEngine.inspectViewable(fs, true, 0, " "); Iterator iter = strings.iterator(); while (iter.hasNext()) { os.write( ((String)iter.next()).getBytes()); } } }