packer.writePayload(msg) results in NullPointerException
Hi
Is this a bug or intended behavior?
import org.msgpack.core.MessageBufferPacker; import org.msgpack.core.MessagePack; import java.io.IOException; public class Main { public static void main(String[] args) { final MessageBufferPacker packer = new MessagePack.PackerConfig() .newBufferPacker(); byte[] msg = new byte[] { -127, -92, 116, 121, 112, 101, -92, 112, 105, 110, 103}; try { packer.writePayload(msg); } catch (IOException e) { e.printStackTrace(); } System.out.println("Done."); } }
This results in:
Exception in thread "main" java.lang.NullPointerException
at org.msgpack.core.MessagePacker.writePayload(MessagePacker.java:733)
at org.msgpack.core.MessagePacker.writePayload(MessagePacker.java:717)
at Main.main(Main.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
I simply want to write raw msgpack bytes to a packer, without any previous header. The bytes already contain the map header.