List of usage examples for java.nio.file Files newByteChannel
public static SeekableByteChannel newByteChannel(Path path, OpenOption... options) throws IOException
From source file:srebrinb.compress.sevenzip.SevenZOutputFile.java
/** * Opens file to write a 7z archive to./*w w w . j av a2 s . c om*/ * * @param filename the file to write to * @throws IOException if opening the file fails */ public SevenZOutputFile(final File filename) throws IOException { this(Files.newByteChannel(filename.toPath(), EnumSet.of(StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING))); }