/** * Disable str8 format when needed backward compatibility between * different msgpack serializer versions. * default true (str8 supported enabled) */ public PackerConfig withStr8FormatSupport(boolean str8FormatSupport) { PackerConfig copy = clone(); copy.str8FormatSupport = str8FormatSupport; return copy; }
/** * When a packer is created with {@link #newPacker(OutputStream)} or {@link #newPacker(WritableByteChannel)}, the stream will be * buffered with this size of buffer (default: 8192). */ public PackerConfig withBufferSize(int bytes) { PackerConfig copy = clone(); copy.bufferSize = bytes; return copy; }
public MessagePackFactory(MessagePackFactory src) { super(src, null); this.packerConfig = src.packerConfig.clone(); this.reuseResourceInGenerator = src.reuseResourceInGenerator; this.reuseResourceInParser = src.reuseResourceInParser; if (src.extTypeCustomDesers != null) { this.extTypeCustomDesers = new ExtensionTypeCustomDeserializers(src.extTypeCustomDesers); } }
/** * When the next payload size exceeds this threshold, MessagePacker will call * {@link org.msgpack.core.buffer.MessageBufferOutput#flush()} before writing more data (default: 8192). */ public PackerConfig withBufferFlushThreshold(int bytes) { PackerConfig copy = clone(); copy.bufferFlushThreshold = bytes; return copy; }
/** * Use String.getBytes() for converting Java Strings that are shorter than this threshold. * Note that this parameter is subject to change. */ public PackerConfig withSmallStringOptimizationThreshold(int length) { PackerConfig copy = clone(); copy.smallStringOptimizationThreshold = length; return copy; }