/** * Create an MessagePacker that outputs the packed data to the given {@link org.msgpack.core.buffer.MessageBufferOutput}. * This method is available for subclasses to override. Use MessagePack.PackerConfig.newPacker method to instanciate this implementation. * * @param out MessageBufferOutput. Use {@link org.msgpack.core.buffer.OutputStreamBufferOutput}, {@link org.msgpack.core.buffer.ChannelBufferOutput} or * your own implementation of {@link org.msgpack.core.buffer.MessageBufferOutput} interface. */ protected MessagePacker(MessageBufferOutput out, MessagePack.PackerConfig config) { this.out = checkNotNull(out, "MessageBufferOutput is null"); this.smallStringOptimizationThreshold = config.getSmallStringOptimizationThreshold(); this.bufferFlushThreshold = config.getBufferFlushThreshold(); this.str8FormatSupport = config.isStr8FormatSupport(); this.position = 0; this.totalFlushBytes = 0; }
public MsgpackWriteSink(WriteSink sink, MessagePack.PackerConfig config) { this(sink, config.isStr8FormatSupport()); }