Class MarshaledResponseBody.FileChannel
java.lang.Object
com.soklet.MarshaledResponseBody.FileChannel
- All Implemented Interfaces:
MarshaledResponseBody
- Enclosing interface:
MarshaledResponseBody
public static final class MarshaledResponseBody.FileChannel
extends Object
implements MarshaledResponseBody
A finalized response body backed by a
FileChannel.- Author:
- Mark Allen
-
Nested Class Summary
Nested classes/interfaces inherited from interface MarshaledResponseBody
MarshaledResponseBody.ByteBuffer, MarshaledResponseBody.Bytes, MarshaledResponseBody.File, MarshaledResponseBody.FileChannelModifier and TypeInterfaceDescriptionstatic final classA finalized response body backed by aByteBuffer.static final classA finalized response body backed by a byte array.static final classA finalized response body backed by a file path.static final classA finalized response body backed by aFileChannel. -
Constructor Summary
ConstructorsConstructorDescriptionFileChannel(@NonNull FileChannel channel, @NonNull Long offset, @NonNull Long count, @NonNull Boolean closeOnComplete) -
Method Summary
Modifier and TypeMethodDescriptionThe file channel backing this body.Whether Soklet should close this caller-supplied channel after the response completes or fails.getCount()The number of channel bytes to write.The number of bytes this body will write.The zero-based channel offset from which response bytes should be written.
-
Constructor Details
-
FileChannel
public FileChannel(@NonNull FileChannel channel, @NonNull Long offset, @NonNull Long count, @NonNull Boolean closeOnComplete)
-
-
Method Details
-
getChannel
The file channel backing this body.- Returns:
- the file channel
-
getOffset
-
getCount
-
getCloseOnComplete
Whether Soklet should close this caller-supplied channel after the response completes or fails.- Returns:
trueif Soklet should close the channel
-
getLength
Description copied from interface:MarshaledResponseBodyThe number of bytes this body will write.- Specified by:
getLengthin interfaceMarshaledResponseBody- Returns:
- the body length
-