| Modifier and Type | Method | Description |
|---|---|---|
static java.util.stream.Collector<java.nio.ByteBuffer,java.io.ByteArrayOutputStream,java.nio.ByteBuffer> |
byteBuffer2Collector() |
A collector of
ByteBuffer instances into a single ByteBuffer instance. |
static java.util.stream.Collector<java.nio.ByteBuffer,java.io.ByteArrayOutputStream,byte[]> |
byteBufferByteArrayCollector() |
A collector of
ByteBuffer instances into a single byte array. |
static java.util.stream.Collector<java.nio.ByteBuffer,java.io.ByteArrayOutputStream,java.lang.String> |
byteBufferStringCollector(java.nio.charset.Charset charset) |
A collector of
ByteBuffer instances into a String of the provided
charset. |
protected boolean |
canContinueProcessing() |
Implementation of
tryProcess() which initially was accepted by canProcess() should call this method
before every iteration to be sure, that processing can continue (is not paused). |
protected boolean |
canProcess() |
Implementation of
tryProcess() method should call this to reserve initial handle processing (if possible). |
protected java.lang.Runnable |
getOnComplete() |
|
protected java.util.function.BiConsumer<T,Pausable> |
getOnData() |
|
protected java.util.function.Consumer<java.lang.Throwable> |
getOnError() |
|
void |
handle(java.util.function.BiConsumer<T,Pausable> onData,
java.util.function.Consumer<java.lang.Throwable> onError,
java.lang.Runnable onComplete) |
|
protected void |
handleError(java.lang.Throwable thr) |
|
protected java.nio.ByteBuffer |
moreData() |
|
void |
pause() |
Pause data chunks flow until
Pausable.resume(). |
protected boolean |
paused() |
|
protected void |
releaseProcessing() |
|
void |
resume() |
Resume data chunks flow after
Pausable.pause(). |
protected void |
tryProcess() |
Implements item handling / processing.
|
protected java.nio.ByteBuffer moreData()
throws java.lang.Throwable
java.lang.Throwablepublic static java.util.stream.Collector<java.nio.ByteBuffer,java.io.ByteArrayOutputStream,java.lang.String> byteBufferStringCollector(java.nio.charset.Charset charset)
ByteBuffer instances into a String of the provided
charset.charset - the desired charset of the returned stringpublic static java.util.stream.Collector<java.nio.ByteBuffer,java.io.ByteArrayOutputStream,java.nio.ByteBuffer> byteBuffer2Collector()
ByteBuffer instances into a single ByteBuffer instance.public static java.util.stream.Collector<java.nio.ByteBuffer,java.io.ByteArrayOutputStream,byte[]> byteBufferByteArrayCollector()
ByteBuffer instances into a single byte array.protected void tryProcess()
canProcess() and canContinueProcessing()
method to ensure, that processing is done by a single thread at a time.public void pause()
PausablePausable.resume().public void resume()
PausablePausable.pause().public void handle(java.util.function.BiConsumer<T,Pausable> onData, java.util.function.Consumer<java.lang.Throwable> onError, java.lang.Runnable onComplete)
protected boolean canProcess()
tryProcess() method should call this to reserve initial handle processing (if possible).
The same method should call canContinueProcessing() before every iteration to be sure, that handle processing
should continue.true only if method can process (handle) itemprotected boolean canContinueProcessing()
tryProcess() which initially was accepted by canProcess() should call this method
before every iteration to be sure, that processing can continue (is not paused).true only if method can continue with handle processingprotected boolean paused()
protected void releaseProcessing()
protected void handleError(java.lang.Throwable thr)
protected java.util.function.BiConsumer<T,Pausable> getOnData()
protected java.util.function.Consumer<java.lang.Throwable> getOnError()
protected java.lang.Runnable getOnComplete()
Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.