Title: InputStream from Socket throws NullPointerException for Unpacker · Issue #217 · msgpack/msgpack-java · GitHub
Open Graph Title: InputStream from Socket throws NullPointerException for Unpacker · Issue #217 · msgpack/msgpack-java
X Title: InputStream from Socket throws NullPointerException for Unpacker · Issue #217 · msgpack/msgpack-java
Description: Version: 0.7.0-p8 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(socke...
Open Graph Description: Version: 0.7.0-p8 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....
X Description: Version: 0.7.0-p8 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 Sock...
Opengraph URL: https://github.com/msgpack/msgpack-java/issues/217
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"InputStream from Socket throws NullPointerException for Unpacker","articleBody":"Version: 0.7.0-p8\n\nI'm trying to create an unpacker from a socket's input stream. It currently throws a NullPointerException \n\n```\nMessagePack msgPack = new MessagePack();\nSocket socket = new Socket(\"127.0.0.1\", 6666);\nmsgPack.newUnpacker(socket.getInputStream());\n```\n\nStack Trace\n\n```\nException in thread \"main\" java.lang.NullPointerException: input channel is null\n at org.msgpack.core.Preconditions.checkNotNull(Preconditions.java:203)\n at org.msgpack.core.buffer.ChannelBufferInput.\u003cinit\u003e(ChannelBufferInput.java:23)\n at org.msgpack.core.buffer.ChannelBufferInput.\u003cinit\u003e(ChannelBufferInput.java:19)\n at org.msgpack.core.buffer.InputStreamBufferInput.newBufferInput(InputStreamBufferInput.java:21)\n at org.msgpack.core.MessagePack.newUnpacker(MessagePack.java:360)\n```\n\nThis happens inside `InputStreamBufferInput.newBufferInput` since the InputStream from the socket is a `FileInputStream` however It doesn't have a channel\n\n```\npublic static MessageBufferInput newBufferInput(InputStream in) {\n checkNotNull(in, \"InputStream is null\");\n if (in instanceof FileInputStream) {\n return new ChannelBufferInput(((FileInputStream) in).getChannel());\n }\n return new InputStreamBufferInput(in);\n```\n\n }\n\nHow should I create an unpacker from a socket?\n","author":{"url":"https://github.com/fdinoff","@type":"Person","name":"fdinoff"},"datePublished":"2015-04-27T01:25:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/217/msgpack-java/issues/217"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:713e6051-afed-1a99-7998-a455091014fc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8582:1BB425:2F6955E:407880B:6A53D804 |
| html-safe-nonce | aa8db09b9c9b4e69eb17f523d084aebe34c636351f9389647cfa82fdb5314642 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTgyOjFCQjQyNToyRjY5NTVFOjQwNzg4MEI6NkE1M0Q4MDQiLCJ2aXNpdG9yX2lkIjoiNDI1MDA2OTA4ODM1NTk5NzcwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 93834cfcd7043da614a082e2f3709be9de3786840eef94850c2ba091b0bdad90 |
| hovercard-subject-tag | issue:71146637 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/msgpack/msgpack-java/217/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c24cb548730bf672c52c8f8c4abaad77b871c9d2fd551092d665a8c4e8076639/msgpack/msgpack-java/issues/217 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c24cb548730bf672c52c8f8c4abaad77b871c9d2fd551092d665a8c4e8076639/msgpack/msgpack-java/issues/217 |
| og:image:alt | Version: 0.7.0-p8 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.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fdinoff |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/msgpack/msgpack-java git https://github.com/msgpack/msgpack-java.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 1971346 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1971346 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width