Package io.activej.csp.file
Class ChannelFileWriter
java.lang.Object
io.activej.async.process.AbstractAsyncCloseable
io.activej.csp.AbstractChannelConsumer<io.activej.bytebuf.ByteBuf>
io.activej.csp.file.ChannelFileWriter
- All Implemented Interfaces:
io.activej.async.process.AsyncCloseable,io.activej.common.initializer.WithInitializer<ChannelFileWriter>,ChannelConsumer<io.activej.bytebuf.ByteBuf>
public final class ChannelFileWriter
extends AbstractChannelConsumer<io.activej.bytebuf.ByteBuf>
implements io.activej.common.initializer.WithInitializer<ChannelFileWriter>
This consumer allows you to asynchronously write binary data to a file.
-
Field Summary
Fields inherited from class io.activej.csp.AbstractChannelConsumer
CHECKFields inherited from class io.activej.async.process.AbstractAsyncCloseable
eventloopFields inherited from interface io.activej.async.process.AsyncCloseable
STATIC -
Method Summary
Modifier and TypeMethodDescriptionstatic ChannelFileWritercreate(io.activej.async.file.AsyncFileService fileService, FileChannel channel) static ChannelFileWritercreate(Executor executor, FileChannel channel) protected io.activej.promise.Promise<Void>doAccept(io.activej.bytebuf.ByteBuf buf) longprotected voidstatic io.activej.promise.Promise<ChannelFileWriter>static io.activej.promise.Promise<ChannelFileWriter>open(Executor executor, Path path, OpenOption... openOptions) static ChannelFileWriteropenBlocking(Executor executor, Path path) static ChannelFileWriteropenBlocking(Executor executor, Path path, OpenOption... openOptions) toString()withForceOnClose(boolean forceMetadata) withOffset(long offset) Methods inherited from class io.activej.csp.AbstractChannelConsumer
acceptMethods inherited from class io.activej.async.process.AbstractAsyncCloseable
closeEx, doSanitize, getException, isClosed, onCleanup, sanitize, setCloseableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.activej.async.process.AsyncCloseable
close, closeExMethods inherited from interface io.activej.csp.ChannelConsumer
acceptAll, acceptAll, acceptAll, acceptEndOfStream, async, filter, map, mapAsync, peek, transformWith, withAcknowledgement, withExecutorMethods inherited from interface io.activej.common.initializer.WithInitializer
withInitializer
-
Method Details
-
create
-
create
public static ChannelFileWriter create(io.activej.async.file.AsyncFileService fileService, FileChannel channel) -
open
-
open
public static io.activej.promise.Promise<ChannelFileWriter> open(Executor executor, Path path, OpenOption... openOptions) -
openBlocking
- Throws:
IOException
-
openBlocking
public static ChannelFileWriter openBlocking(Executor executor, Path path, OpenOption... openOptions) throws IOException - Throws:
IOException
-
withForceOnClose
-
withOffset
-
getPosition
public long getPosition() -
onClosed
- Overrides:
onClosedin classio.activej.async.process.AbstractAsyncCloseable
-
doAccept
- Specified by:
doAcceptin classAbstractChannelConsumer<io.activej.bytebuf.ByteBuf>
-
toString
-