-
Notifications
You must be signed in to change notification settings - Fork 321
V07 unpacker #100
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
Merged
Merged
V07 unpacker #100
Changes from all commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
51d2834
Split the code into MessageUnpacker and NonBlockingMessageUnpacker. A…
xerial 77f6a00
Fix fixarray and fixmap header econding
xerial 9efb863
Add array and binary test
xerial 38ded46
Add map test
xerial 610354d
Catch EOFException in skip(). Compare the performacne of two skip imp…
xerial c4c0bc6
Removed polymorphic skip function because switch statement is faster
xerial 0b2f524
Removed debug message
xerial bfe78f7
Add nil test
xerial 5d30d6f
Implement hashCode and equals in ExtendedTypeHeader
xerial 5f3a8ee
Add Closeable interface to MessagePacker
xerial 78d907c
Detect valid UTF8 string in generating random strings
xerial 6dce839
Fix the bit mask in readNextLength16
xerial 03ff136
Fix packBigInteger to properly output integer less than 64 bit. Let u…
xerial 66d93a3
Enhance comments
xerial 5f5a5f7
Move property based testing into MessagePackTest
xerial e9255cc
Handle data at the buffer boundary
xerial e8e369c
Add extended type tests
xerial 56256fe
Fix the behavior of ensure(n) at the buffer boundary
xerial d11af8e
Add test that unpack data at the buffer boundary
xerial fcf8ee7
Fix extra buffer switch
xerial 61f075c
Run boundary test for larger data
xerial c16de8a
Fix comment
xerial 8d3fa2e
Simplified the code for swithing to the extra buffer
xerial c9d8612
Add some constructors. Enhance comments
xerial 1a943cf
Fix comments
xerial 12a6bca
Sanitized the code
xerial bb0e31e
Add MessageUnpacker configuration
xerial 6c514cc
Fixes #93: Preparing CharBuffer for unpackString
xerial 32ebdb2
#91: Add comments
xerial d3e0659
Fixes #93: Prepareing ByteBuffer for encoding UTF8 string in packString
xerial 364c085
#93: Flushes the decoder only when endOfInput == true
xerial 5b03e4d
#93: Call CharsetEncoder.flush properly
xerial e383ac6
Add a benchmark that compares skip performance between v6 and v7
xerial 7a816ab
Add read value performance comparison between v6 and v7
xerial d663913
reuse buffer
xerial bfadb34
Removed unnecessary try-catch block
xerial b0fc482
Fix comment of skipValue()
xerial e0de2b6
Rename function to ensureBuffer
xerial 261e6ed
Removing final keyword from local variables since this style is not c…
xerial 352fc7b
Simplfied ensure() code
xerial b0054d7
removed boxed value
xerial 0c802af
Disable concurrent test execution for producing accurate benchmark re…
xerial a8354af
Fix some comments
xerial 7b69122
Add README
xerial 2d73708
Add jacoco and findbugs plugin.
xerial edb9623
Move a configuration parameter to MessagePack.Config
xerial ad7474b
Update README.md
xerial 8f2ca85
Delete develop.md since its contents are in README
xerial c22c6f7
Lazy initializtion of encoder and decoder to decrease the initializat…
xerial 21ef571
Add description of MessageUnpacker
xerial 0a32e34
fix comment
xerial 784f467
Insert warmup runs
xerial 1555408
Always display benchmark results
xerial 0cbcf66
Cleanup imports
xerial ef322bf
#101: Workaround for Android OS. Creating Unsafe instance by calling …
xerial 413a28d
#101: Fix comments
xerial b4497cb
#100 Using immutable fields and a builder for Config object
xerial f1ce805
#100: Throwing EOFException when incoming data size is insufficient
xerial c0a7af1
#100: Optimize FIXINT and buffer emptiness checks
xerial 9319d52
#103 Optimization for ByteArrayInputStream
xerial 60f3a13
Use bufferSize argument
xerial b71b05a
Use ChannelBufferInput when FileInputStream is passed to the unpacker
xerial c963037
Added test cases for reading various types of MessageBufferInputs, an…
xerial 952996e
#103: Simplified ArrayBufferInput
xerial 2657f07
#100 Fixes readLen computation in unpackString
xerial 32fa547
#100: Add a test case for pack/unpack large strings
xerial 882abb7
#100: Add test cases of reading malformed UTF-8 strings
xerial 0e30c43
#100: Add test cases for FIXEXT. Fix unmappable UTF8 character check
xerial a2adc90
#100: Add test cases to increase the code coverage from 83% to 95%
xerial ac0b18c
#100: Add a test for unmappable characters
xerial e65da3e
#104: Fix assertion condition
xerial ed0f7cc
#104: Applied review comments. Added some assertions. Fixed MessageBu…
xerial f53e5ae
Merge pull request #104 from msgpack/v07-unpack-binary
xerial c1cfb7f
Merge branch 'v07-unpacker' of github.com:msgpack/msgpack-java into v…
xerial File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| MessagePack for Java | ||
| === | ||
|
|
||
| [MessagePack](http://msgpack.org) is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small integers are encoded into a single byte, and typical short strings require only one extra byte in addition to the strings themselves. | ||
|
|
||
| * Message Pack specification: <https://github.com/msgpack/msgpack/blob/master/spec.md> | ||
|
|
||
| ## Quick Start | ||
|
|
||
| For Maven users: | ||
| ``` | ||
| <dependency> | ||
| <groupId>org.msgpack</groupId> | ||
| <artifactId>msgpack-core</artifactId> | ||
| <version>0.7.0</version> | ||
| </dependency> | ||
| ``` | ||
|
|
||
| For sbt users: | ||
| ``` | ||
| libraryDependencies += "org.msgpack" % "msgpack-core" % "0.7.0" | ||
| ``` | ||
|
|
||
|
|
||
| ## For Developers | ||
|
|
||
| msgpack-java uses [sbt](http://www.scala-sbt.org/) for building the projects. For the basic usage of sbt, see: | ||
| * [Building Java projects with sbt](http://xerial.org/blog/2014/03/24/sbt/) | ||
|
|
||
| ### Basic sbt commands | ||
| Enter the sbt console: | ||
| ``` | ||
| $ ./sbt | ||
| ``` | ||
|
|
||
| Here is a list of sbt commands for daily development: | ||
| ``` | ||
| > ~compile # Compile source codes | ||
| > ~test:compile # Compile both source and test codes | ||
| > ~test # Run tests upon source code change | ||
| > ~test-only *MessagePackTest # Run tests in the specified class | ||
| > ~test-only *MessagePackTest -- -n prim # Run the test tagged as "prim" | ||
| > project msgpack-core # Focus on a specific project | ||
| > package # Create a jar file in the target folder of each project | ||
| > findbugs # Produce findbugs report in target/findbugs | ||
| > jacoco:cover # Report the code coverage of tests to target/jacoco folder | ||
| ``` | ||
|
|
||
| ### Publishing | ||
|
|
||
| ``` | ||
| > publishLocal # Install to local .ivy2 repository | ||
| > publishM2 # Install to local .m2 Maven repository | ||
| > publishSigned # Publish GPG signed artifacts to the Sonatype repository | ||
| > sonatypeRelease # Publish to the Maven Central (It will be synched within less than 4 hours) | ||
| ``` | ||
|
|
||
| For publishing to Maven central, msgpack-java uses [sbt-sonatype](https://github.com/xerial/sbt-sonatype) plugin. Set Sonatype account information (user name and password) in the global sbt settings. To protect your password, never include this file in your project. | ||
|
|
||
| ___$HOME/.sbt/(sbt-version)/sonatype.sbt___ | ||
|
|
||
| ``` | ||
| credentials += Credentials("Sonatype Nexus Repository Manager", | ||
| "oss.sonatype.org", | ||
| "(Sonatype user name)", | ||
| "(Sonatype password)") | ||
| ``` | ||
|
|
||
| ### Project Structure | ||
|
|
||
| ``` | ||
| msgpack-core # Contains packer/unpacker implementation that never uses third-party libraries | ||
| ``` |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we check whether
objis null or not?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.
null instanceof xxx returns false, so we do not need null check here:
http://stackoverflow.com/questions/2950319/is-null-check-needed-before-calling-instanceof
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.
Thank you for the explanation! 👍