Package io.activej.csp.process
Class ChannelByteRanger
java.lang.Object
io.activej.csp.process.AbstractCommunicatingProcess
io.activej.csp.process.AbstractChannelTransformer<ChannelByteRanger,io.activej.bytebuf.ByteBuf,io.activej.bytebuf.ByteBuf>
io.activej.csp.process.ChannelByteRanger
- All Implemented Interfaces:
io.activej.async.process.AsyncCloseable,io.activej.async.process.AsyncProcess,ChannelConsumerTransformer<io.activej.bytebuf.ByteBuf,,ChannelConsumer<io.activej.bytebuf.ByteBuf>> ChannelSupplierTransformer<io.activej.bytebuf.ByteBuf,,ChannelSupplier<io.activej.bytebuf.ByteBuf>> ChannelTransformer<io.activej.bytebuf.ByteBuf,,io.activej.bytebuf.ByteBuf> HasChannelInput<io.activej.bytebuf.ByteBuf>,HasChannelOutput<io.activej.bytebuf.ByteBuf>,WithChannelInput<ChannelByteRanger,,io.activej.bytebuf.ByteBuf> WithChannelOutput<ChannelByteRanger,,io.activej.bytebuf.ByteBuf> WithChannelTransformer<ChannelByteRanger,io.activej.bytebuf.ByteBuf, io.activej.bytebuf.ByteBuf>
public final class ChannelByteRanger
extends AbstractChannelTransformer<ChannelByteRanger,io.activej.bytebuf.ByteBuf,io.activej.bytebuf.ByteBuf>
Drops exactly N bytes from a csp stream of byte buffers and limits that stream to exactly M bytes in length
-
Field Summary
Fields inherited from class io.activej.csp.process.AbstractChannelTransformer
input, outputFields inherited from interface io.activej.async.process.AsyncCloseable
STATIC -
Method Summary
Modifier and TypeMethodDescriptionstatic ChannelTransformer<io.activej.bytebuf.ByteBuf,io.activej.bytebuf.ByteBuf> drop(long toDrop) static ChannelTransformer<io.activej.bytebuf.ByteBuf,io.activej.bytebuf.ByteBuf> limit(long limit) protected @NotNull io.activej.promise.Promise<Void>onItem(io.activej.bytebuf.ByteBuf item) static ChannelTransformer<io.activej.bytebuf.ByteBuf,io.activej.bytebuf.ByteBuf> range(long offset, long length) Methods inherited from class io.activej.csp.process.AbstractChannelTransformer
beforeProcess, doClose, doProcess, getInput, getOutput, onCleanup, onProcessFinish, onProcessStart, send, sendEndOfStreamMethods inherited from class io.activej.csp.process.AbstractCommunicatingProcess
afterProcess, close, closeEx, completeProcess, completeProcessEx, doSanitize, getProcessCompletion, isProcessComplete, isProcessStarted, sanitize, sanitize, sanitize, sanitize, startProcessMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.activej.csp.dsl.WithChannelInput
withInputMethods inherited from interface io.activej.csp.dsl.WithChannelOutput
withOutputMethods inherited from interface io.activej.csp.dsl.WithChannelTransformer
transform, transform
-
Method Details
-
range
public static ChannelTransformer<io.activej.bytebuf.ByteBuf,io.activej.bytebuf.ByteBuf> range(long offset, long length) -
drop
public static ChannelTransformer<io.activej.bytebuf.ByteBuf,io.activej.bytebuf.ByteBuf> drop(long toDrop) -
limit
public static ChannelTransformer<io.activej.bytebuf.ByteBuf,io.activej.bytebuf.ByteBuf> limit(long limit) -
onItem
@NotNull protected @NotNull io.activej.promise.Promise<Void> onItem(io.activej.bytebuf.ByteBuf item) - Specified by:
onItemin classAbstractChannelTransformer<ChannelByteRanger,io.activej.bytebuf.ByteBuf, io.activej.bytebuf.ByteBuf>
-