Interface MessageReader.OptionBuilder
- Enclosing interface:
MessageReader
public static sealed interface MessageReader.OptionBuilder
A builder of message reader options.
-
Method Summary
Modifier and TypeMethodDescriptionallocator(BufferAllocator allocator) Sets the buffer allocator to be used by the message writer.identifierDecoder(MessageDecoder<String> decoder) Sets the string decoder to be used byMessageReader.readIdentifier().readBufferCapacity(int capacity) Sets the capacity of the message reader's read buffer.stringDecoder(MessageDecoder<String> decoder) Sets the string decoder to be used byMessageReader.readString().
-
Method Details
-
allocator
Sets the buffer allocator to be used by the message writer.
Default:
BufferAllocator.ofUnpooled()- Parameters:
allocator- the buffer allocator to be used by the message writer- Returns:
- this builder
-
readBufferCapacity
Sets the capacity of the message reader's read buffer.
This option may affect I/O read performance.
Default:
1024 * 8- Parameters:
capacity- the capacity of the message reader's read buffer- Returns:
- this builder
-
stringDecoder
Sets the string decoder to be used by
MessageReader.readString().Default:
MessageDecoder.ofString()- Parameters:
decoder- the string decoder to be used byMessageReader.readString()- Returns:
- this builder
-
identifierDecoder
Sets the string decoder to be used by
MessageReader.readIdentifier().Default:
MessageDecoder.ofString()- Parameters:
decoder- the string decoder to be used byMessageReader.readIdentifier()- Returns:
- this builder
-