Class StreamingResponseBody.ReaderBuilder
java.lang.Object
com.soklet.StreamingResponseBody.ReaderBuilder
- Enclosing interface:
StreamingResponseBody
Builder for reader-backed response bodies.
This class is intended for use by a single thread.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbufferSizeInCharacters(@Nullable Integer bufferSizeInCharacters) Sets the reader copy buffer size.build()Builds a reader-backed response body.malformedInputAction(@Nullable CodingErrorAction malformedInputAction) Sets encoder behavior for malformed input.unmappableCharacterAction(@Nullable CodingErrorAction unmappableCharacterAction) Sets encoder behavior for unmappable characters.
-
Method Details
-
bufferSizeInCharacters
public @NonNull StreamingResponseBody.ReaderBuilder bufferSizeInCharacters(@Nullable Integer bufferSizeInCharacters) Sets the reader copy buffer size.- Parameters:
bufferSizeInCharacters- buffer size in characters, ornullfor the default- Returns:
- this builder
-
malformedInputAction
public @NonNull StreamingResponseBody.ReaderBuilder malformedInputAction(@Nullable CodingErrorAction malformedInputAction) Sets encoder behavior for malformed input.- Parameters:
malformedInputAction- malformed-input behavior, ornullfor the default- Returns:
- this builder
-
unmappableCharacterAction
public @NonNull StreamingResponseBody.ReaderBuilder unmappableCharacterAction(@Nullable CodingErrorAction unmappableCharacterAction) Sets encoder behavior for unmappable characters.- Parameters:
unmappableCharacterAction- unmappable-character behavior, ornullfor the default- Returns:
- this builder
-
build
Builds a reader-backed response body.- Returns:
- a streaming response body
-