You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create an unpacker from a socket's input stream. It currently throws a NullPointerException
MessagePack msgPack = new MessagePack();
Socket socket = new Socket("127.0.0.1", 6666);
msgPack.newUnpacker(socket.getInputStream());
Stack Trace
Exception in thread "main" java.lang.NullPointerException: input channel is null
at org.msgpack.core.Preconditions.checkNotNull(Preconditions.java:203)
at org.msgpack.core.buffer.ChannelBufferInput.<init>(ChannelBufferInput.java:23)
at org.msgpack.core.buffer.ChannelBufferInput.<init>(ChannelBufferInput.java:19)
at org.msgpack.core.buffer.InputStreamBufferInput.newBufferInput(InputStreamBufferInput.java:21)
at org.msgpack.core.MessagePack.newUnpacker(MessagePack.java:360)
This happens inside InputStreamBufferInput.newBufferInput since the InputStream from the socket is a FileInputStream however It doesn't have a channel
public static MessageBufferInput newBufferInput(InputStream in) {
checkNotNull(in, "InputStream is null");
if (in instanceof FileInputStream) {
return new ChannelBufferInput(((FileInputStream) in).getChannel());
}
return new InputStreamBufferInput(in);
}
How should I create an unpacker from a socket?
The text was updated successfully, but these errors were encountered:
Version: 0.7.0-p8
I'm trying to create an unpacker from a socket's input stream. It currently throws a NullPointerException
Stack Trace
This happens inside
InputStreamBufferInput.newBufferInput
since the InputStream from the socket is aFileInputStream
however It doesn't have a channel}
How should I create an unpacker from a socket?
The text was updated successfully, but these errors were encountered: