Package io.activej.csp.file
Class ChannelFileReader
java.lang.Object
io.activej.reactor.AbstractReactive
io.activej.reactor.ImplicitlyReactive
io.activej.async.process.AbstractAsyncCloseable
io.activej.csp.supplier.AbstractChannelSupplier<io.activej.bytebuf.ByteBuf>
io.activej.csp.file.ChannelFileReader
- All Implemented Interfaces:
io.activej.async.process.AsyncCloseable,ChannelSupplier<io.activej.bytebuf.ByteBuf>,io.activej.reactor.Reactive
This supplier allows you to asynchronously read binary data from a file.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class io.activej.reactor.AbstractReactive
reactorFields inherited from interface io.activej.async.process.AsyncCloseable
STATIC -
Method Summary
Modifier and TypeMethodDescriptionstatic ChannelFileReader.Builderbuilder(io.activej.async.file.IFileService fileService, FileChannel channel) static ChannelFileReader.Builderbuilder(io.activej.reactor.Reactor reactor, Executor executor, FileChannel channel) static ChannelFileReader.BuilderbuilderBlocking(io.activej.reactor.Reactor reactor, Executor executor, Path path) static ChannelFileReader.BuilderbuilderBlocking(io.activej.reactor.Reactor reactor, Executor executor, Path path, OpenOption... openOptions) static io.activej.promise.Promise<ChannelFileReader.Builder>builderOpen(Executor executor, Path path) static io.activej.promise.Promise<ChannelFileReader.Builder>builderOpen(Executor executor, Path path, OpenOption... openOptions) static ChannelFileReadercreate(io.activej.async.file.IFileService fileService, FileChannel channel) static ChannelFileReadercreate(io.activej.reactor.Reactor reactor, Executor executor, FileChannel channel) protected io.activej.promise.Promise<io.activej.bytebuf.ByteBuf>doGet()longprotected voidstatic io.activej.promise.Promise<ChannelFileReader>static io.activej.promise.Promise<ChannelFileReader>open(Executor executor, Path path, OpenOption... openOptions) static ChannelFileReaderopenBlocking(io.activej.reactor.Reactor reactor, Executor executor, Path path) static ChannelFileReaderopenBlocking(io.activej.reactor.Reactor reactor, Executor executor, Path path, OpenOption... openOptions) toString()Methods inherited from class io.activej.csp.supplier.AbstractChannelSupplier
getMethods inherited from class io.activej.async.process.AbstractAsyncCloseable
closeEx, doSanitize, getCloseable, getException, isClosed, onCleanup, sanitize, setCloseableMethods inherited from class io.activej.reactor.AbstractReactive
getReactorMethods 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.supplier.ChannelSupplier
async, bindTo, filter, lenient, map, mapAsync, peek, streamTo, streamTo, toCollector, toList, transformWith, until, withEndOfStream, withExecutor
-
Field Details
-
DEFAULT_BUFFER_SIZE
public static final io.activej.common.MemSize DEFAULT_BUFFER_SIZE
-
-
Method Details
-
create
public static ChannelFileReader create(io.activej.reactor.Reactor reactor, Executor executor, FileChannel channel) -
create
public static ChannelFileReader create(io.activej.async.file.IFileService fileService, FileChannel channel) -
open
-
open
public static io.activej.promise.Promise<ChannelFileReader> open(Executor executor, Path path, OpenOption... openOptions) -
openBlocking
public static ChannelFileReader openBlocking(io.activej.reactor.Reactor reactor, Executor executor, Path path) throws IOException - Throws:
IOException
-
openBlocking
public static ChannelFileReader openBlocking(io.activej.reactor.Reactor reactor, Executor executor, Path path, OpenOption... openOptions) throws IOException - Throws:
IOException
-
builder
public static ChannelFileReader.Builder builder(io.activej.reactor.Reactor reactor, Executor executor, FileChannel channel) -
builder
public static ChannelFileReader.Builder builder(io.activej.async.file.IFileService fileService, FileChannel channel) -
builderOpen
public static io.activej.promise.Promise<ChannelFileReader.Builder> builderOpen(Executor executor, Path path) -
builderOpen
public static io.activej.promise.Promise<ChannelFileReader.Builder> builderOpen(Executor executor, Path path, OpenOption... openOptions) -
builderBlocking
public static ChannelFileReader.Builder builderBlocking(io.activej.reactor.Reactor reactor, Executor executor, Path path) throws IOException - Throws:
IOException
-
builderBlocking
public static ChannelFileReader.Builder builderBlocking(io.activej.reactor.Reactor reactor, Executor executor, Path path, OpenOption... openOptions) throws IOException - Throws:
IOException
-
getPosition
public long getPosition() -
doGet
protected io.activej.promise.Promise<io.activej.bytebuf.ByteBuf> doGet()- Specified by:
doGetin classAbstractChannelSupplier<io.activej.bytebuf.ByteBuf>
-
onClosed
- Overrides:
onClosedin classio.activej.async.process.AbstractAsyncCloseable
-
toString
-