}
public MessagePackGenerator(int features, ObjectCodec codec, OutputStream out) throws IOException {
super(features, codec);
MessagePacker messagePacker = messagePackersHolder.get();
OutputStreamBufferOutput messageBufferOutput = messageBufferOutputHolder.get();
if (messageBufferOutput == null) {
messageBufferOutput = new OutputStreamBufferOutput(out);
}
else {
messageBufferOutput.reset(out);
}
messageBufferOutputHolder.set(messageBufferOutput);
if (messagePacker == null) {
messagePacker = new MessagePacker(messageBufferOutput);