mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-03 01:54:45 +02:00
java: Packer: supports Set
This commit is contained in:
parent
0bd4150a80
commit
a3b1ef9527
@ -21,6 +21,7 @@ import java.io.OutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
|
||||||
@ -449,6 +450,11 @@ public class Packer {
|
|||||||
packArray(l.size());
|
packArray(l.size());
|
||||||
for(Object i : l) { pack(i); }
|
for(Object i : l) { pack(i); }
|
||||||
return this;
|
return this;
|
||||||
|
} else if(o instanceof Set) {
|
||||||
|
Set<Object> l = (Set<Object>)o;
|
||||||
|
packArray(l.size());
|
||||||
|
for(Object i : l) { pack(i); }
|
||||||
|
return this;
|
||||||
} else if(o instanceof Map) {
|
} else if(o instanceof Map) {
|
||||||
Map<Object,Object> m = (Map<Object,Object>)o;
|
Map<Object,Object> m = (Map<Object,Object>)o;
|
||||||
packMap(m.size());
|
packMap(m.size());
|
||||||
|
@ -21,6 +21,10 @@ import java.io.IOException;
|
|||||||
import org.msgpack.*;
|
import org.msgpack.*;
|
||||||
|
|
||||||
public class ClassTemplate implements Template {
|
public class ClassTemplate implements Template {
|
||||||
|
static {
|
||||||
|
Templates.load();
|
||||||
|
}
|
||||||
|
|
||||||
private Class klass;
|
private Class klass;
|
||||||
|
|
||||||
public ClassTemplate(Class klass) {
|
public ClassTemplate(Class klass) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user