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
ser deser ser+deser size | |
----------+------+-------+-----------+-----------+ | |
msgpack | 870 | 229 | 1100 | 268550000 | | |
thrift | 873 | 228 | 1102 | 272450000 | | |
avro | 874 | 303 | 1117 | 265850000 | | |
----------+------+-------+-----------+-----------+ |
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
public static void main(String[] args) throws Exception { | |
java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream(); | |
Packer pk = new Packer(out); | |
pk.pack(new Long(-32769L)); | |
pk.pack(new Long(1L)); | |
pk.pack(new Long(-32769L)); | |
Unpacker upk = new Unpacker(new java.io.ByteArrayInputStream(out.toByteArray())); | |
long r1 = upk.unpackLong(); | |
System.out.println("r1: " + r1); | |
long r2 = upk.unpackLong(); |
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
[muga@f11vm java]$ msgpack-idl --example 'sample' > sample.msgspac | |
[muga@f11vm java]$ msgpack-idl -g java sample.msgsp | |
sample.msgspac sample.msgspec | |
[muga@f11vm java]$ msgpack-idl -g java sample.msgspec | |
/usr/local/rvm/gems/ruby-1.9.1-p376/gems/msgpack-idl-0.1.0/lib/msgpack/idl/parser/transform.rb:198:in `block in <class:ParsletTransform>': uninitialized constant Parslet::Pattern::Context::AST (NameError) | |
from /usr/local/rvm/gems/ruby-1.9.1-p376/gems/parslet-1.2.0/lib/parslet/pattern.rb:49:in `instance_eval' | |
from /usr/local/rvm/gems/ruby-1.9.1-p376/gems/parslet-1.2.0/lib/parslet/pattern.rb:49:in `call_on_match' | |
from /usr/local/rvm/gems/ruby-1.9.1-p376/gems/parslet-1.2.0/lib/parslet/transform.rb:160:in `block in transform_elt' | |
from /usr/local/rvm/gems/ruby-1.9.1-p376/gems/parslet-1.2.0/lib/parslet/transform.rb:157:in `each' | |
from /usr/local/rvm/gems/ruby-1.9.1-p376/gems/parslet-1.2.0/lib/parslet/transform.rb:157:in `transform_elt' |
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
create ser +same deser +shal +deep total size +dfl | |
kryo 98 1463 1375 1849 1878 2013 3476 233 147 | |
protobuf 193 2649 1305 1388 1449 1666 4315 239 149 | |
thrift 188 2802 2635 1722 1781 1849 4651 349 197 | |
msgpack 102 1652 1558 1758 1998 1921 3573 233 146 | |
msgpack-manual 101 1602 1389 1694 1757 1868 3470 233 146 |
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
import org.msgpack.MessagePack; | |
import org.msgpack.annotation.Message; | |
import org.msgpack.packer.Packer; | |
import org.msgpack.template.AbstractTemplate; | |
import org.msgpack.template.Template; | |
import org.msgpack.template.Templates; | |
import org.msgpack.type.ArrayValue; | |
import org.msgpack.type.FloatValue; | |
import org.msgpack.type.IntegerValue; |
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
diff --git a/src/main/java/org/msgpack/template/TemplateRegistry.java b/src/main/java/org/msgpack/template/TemplateRegistry.java | |
index 3045ba3..7a8c267 100644 | |
--- a/src/main/java/org/msgpack/template/TemplateRegistry.java | |
+++ b/src/main/java/org/msgpack/template/TemplateRegistry.java | |
@@ -23,6 +23,7 @@ import java.util.Date; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.HashMap; | |
+import java.lang.reflect.GenericArrayType; | |
import java.lang.reflect.ParameterizedType; |
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
diff --git a/src/main/java/org/msgpack/template/TemplateRegistry.java b/src/main/java/org/msgpack/template/TemplateRegistry.java | |
index 3045ba3..7a8c267 100644 | |
--- a/src/main/java/org/msgpack/template/TemplateRegistry.java | |
+++ b/src/main/java/org/msgpack/template/TemplateRegistry.java | |
@@ -23,6 +23,7 @@ import java.util.Date; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.HashMap; | |
+import java.lang.reflect.GenericArrayType; | |
import java.lang.reflect.ParameterizedType; |
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
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import org.msgpack.MessagePack; | |
import org.msgpack.annotation.Beans; | |
import org.msgpack.packer.Packer; | |
import org.msgpack.template.Template; | |
import org.msgpack.template.TemplateRegistry; | |
import org.msgpack.template.builder.ReflectionBeansTemplateBuilder; | |
import org.msgpack.unpacker.Unpacker; |
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
import static org.mockito.Mockito.mock; | |
import static org.mockito.Mockito.spy; | |
import static org.mockito.Mockito.when; | |
import org.junit.Test; | |
public class Sample { | |
static class Reader { | |
private String fileName; |
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
import java.util.HashMap; | |
import java.util.Map; | |
import org.msgpack.MessagePack; | |
import org.msgpack.type.IntegerValue; | |
import org.msgpack.type.MapValue; | |
import org.msgpack.type.RawValue; | |
import org.msgpack.type.ValueFactory; | |
public class Sample { |
OlderNewer