-
Notifications
You must be signed in to change notification settings - Fork 325
V07 add jackson dataformat #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 65 commits
5b27ce5
579e43c
99688c6
f97ebd8
1d46d19
6985965
c2679d3
b3ba082
51ade22
8d0b5f7
7ea00f2
7acda0e
d6508cb
634de6d
a85aef2
14ecfde
e65a213
0f6ad5f
5058a73
8688a52
944837c
3bb9b49
0616475
74886d0
333c0da
d4b8e6c
7a7aa1a
e6f2cc9
1fecae8
bd17525
2b12e88
b1cbfbf
5a52c70
b5c0a8f
c5d1d10
22ffc25
18a1ffc
d52c597
29117ed
ed02e59
6ad50a5
81485c7
72e6636
7d4d9b6
5a222d4
b536174
47dc9d6
5d02d9a
decec80
ec6eeda
c30aeff
2061241
f5e3f14
48313b9
3038635
26de0b0
4133898
96f9775
b1d601c
2e5d80d
eb1aa42
1386da9
941419d
3f82776
357e507
4dce386
27567df
d2b5faa
8b75906
6ca1176
b34c56a
fdd5f50
ed20171
7c95a9e
825e418
8c50d09
a2bc049
a8f7922
fcb9ae3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| language: java | ||
| jdk: | ||
| - openjdk6 | ||
| - openjdk7 | ||
| - oraclejdk7 | ||
| branches: | ||
| only: | ||
| - master | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package org.msgpack.jackson.dataformat.msgpack; | ||
|
|
||
| import com.fasterxml.jackson.core.*; | ||
| import com.fasterxml.jackson.core.io.IOContext; | ||
|
|
||
| import java.io.ByteArrayInputStream; | ||
| import java.io.IOException; | ||
| import java.io.InputStream; | ||
| import java.io.OutputStream; | ||
| import java.nio.ByteBuffer; | ||
| import java.util.Arrays; | ||
| import java.util.List; | ||
|
|
||
| public class MessagePackFactory extends JsonFactory { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MessagePackFactory is already used in msgpack-core. Can you rename it?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. Jackson-dataformat-xxxx uses a naming convention
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But in the msgpack-jackson/README.md, you mentioned
It's already ambiguous.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed core.MessagePackerFactory, and packer/unpacker can be instantiated from MessagePack class, so it's okay to leave jackson/MessagePackFactory class name unchanged.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All right. Thanks. |
||
| private static final long serialVersionUID = 2578263992015504347L; | ||
| protected int messagePackGeneratorFeature = 0; | ||
| protected int messagePackParserFeature = 0; | ||
|
|
||
| @Override | ||
| public JsonGenerator createGenerator(OutputStream out, JsonEncoding enc) throws IOException { | ||
| return new MessagePackGenerator(messagePackGeneratorFeature, _objectCodec, out); | ||
| } | ||
|
|
||
| @Override | ||
| public JsonParser createParser(byte[] data) throws IOException, JsonParseException { | ||
| IOContext ioContext = _createContext(data, false); | ||
| return _createParser(data, 0, data.length, ioContext); | ||
| } | ||
|
|
||
| @Override | ||
| public JsonParser createParser(InputStream in) throws IOException, JsonParseException { | ||
| IOContext ioContext = _createContext(in, false); | ||
| return _createParser(in, ioContext); | ||
| } | ||
|
|
||
| @Override | ||
| protected MessagePackParser _createParser(InputStream in, IOContext ctxt) throws IOException { | ||
| MessagePackParser parser = new MessagePackParser(ctxt, messagePackParserFeature, in); | ||
| return parser; | ||
| } | ||
|
|
||
| @Override | ||
| protected JsonParser _createParser(byte[] data, int offset, int len, IOContext ctxt) throws IOException, JsonParseException { | ||
| if (offset != 0 || len != data.length) { | ||
| data = Arrays.copyOfRange(data, offset, offset + len); | ||
| } | ||
| MessagePackParser parser = new MessagePackParser(ctxt, messagePackParserFeature, data); | ||
| return parser; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also add oraclejdk8.This file is unnecessary if we build and test all of the module under the root folder.