public void open(Path file, OpenOption... options) throws IOException { if ( fileChannel != null ) throw new RuntimeException("can only open once"); Actor sender = Actor.current(); Set<OpenOption> set = new HashSet<OpenOption>(options.length); Collections.addAll(set, options); fileChannel = AsynchronousFileChannel.open(file, set, new ActorExecutorService(sender), NO_ATTRIBUTES); }
public void open(Path file, OpenOption... options) throws IOException { if ( fileChannel != null ) throw new RuntimeException("can only open once"); Actor sender = Actor.current(); Set<OpenOption> set = new HashSet<OpenOption>(options.length); Collections.addAll(set, options); fileChannel = AsynchronousFileChannel.open(file, set, new ActorExecutorService(sender), NO_ATTRIBUTES); }