0
|
1 //
|
|
2 // MessagePack for Java
|
|
3 //
|
|
4 // Copyright (C) 2009 - 2013 FURUHASHI Sadayuki
|
|
5 //
|
|
6 // Licensed under the Apache License, Version 2.0 (the "License");
|
|
7 // you may not use this file except in compliance with the License.
|
|
8 // You may obtain a copy of the License at
|
|
9 //
|
|
10 // http://www.apache.org/licenses/LICENSE-2.0
|
|
11 //
|
|
12 // Unless required by applicable law or agreed to in writing, software
|
|
13 // distributed under the License is distributed on an "AS IS" BASIS,
|
|
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15 // See the License for the specific language governing permissions and
|
|
16 // limitations under the License.
|
|
17 //
|
|
18 package org.msgpack.unpacker;
|
|
19
|
|
20 import java.io.IOException;
|
|
21 import java.io.Closeable;
|
|
22 import java.nio.ByteBuffer;
|
|
23 import java.math.BigInteger;
|
|
24 import java.lang.Iterable;
|
|
25
|
|
26 import org.msgpack.template.Template;
|
|
27 import org.msgpack.type.Value;
|
|
28 import org.msgpack.type.ValueType;
|
|
29
|
|
30 /**
|
|
31 * Standard deserializer.
|
|
32 *
|
|
33 * @version 0.6.0
|
|
34 */
|
|
35 public interface Unpacker extends Iterable<Value>, Closeable {
|
|
36 public <T> T read(Class<T> klass) throws IOException;
|
|
37
|
|
38 public <T> T read(T to) throws IOException;
|
|
39
|
|
40 public <T> T read(Template<T> tmpl) throws IOException;
|
|
41
|
|
42 public <T> T read(T to, Template<T> tmpl) throws IOException;
|
|
43
|
|
44 public void skip() throws IOException;
|
|
45
|
|
46 public int readArrayBegin() throws IOException;
|
|
47
|
|
48 public void readArrayEnd(boolean check) throws IOException;
|
|
49
|
|
50 public void readArrayEnd() throws IOException;
|
|
51
|
|
52 public int readMapBegin() throws IOException;
|
|
53
|
|
54 public void readMapEnd(boolean check) throws IOException;
|
|
55
|
|
56 public void readMapEnd() throws IOException;
|
|
57
|
|
58 public void readNil() throws IOException;
|
|
59
|
|
60 public boolean trySkipNil() throws IOException;
|
|
61
|
|
62 public boolean readBoolean() throws IOException;
|
|
63
|
|
64 public byte readByte() throws IOException;
|
|
65
|
|
66 public short readShort() throws IOException;
|
|
67
|
|
68 public int readInt() throws IOException;
|
|
69
|
|
70 public long readLong() throws IOException;
|
|
71
|
|
72 public BigInteger readBigInteger() throws IOException;
|
|
73
|
|
74 public float readFloat() throws IOException;
|
|
75
|
|
76 public double readDouble() throws IOException;
|
|
77
|
|
78 public byte[] readByteArray() throws IOException;
|
|
79
|
|
80 public ByteBuffer readByteBuffer() throws IOException;
|
|
81
|
|
82 public String readString() throws IOException;
|
|
83
|
|
84 public Value readValue() throws IOException;
|
|
85
|
|
86 public ValueType getNextType() throws IOException;
|
|
87
|
|
88 public UnpackerIterator iterator();
|
|
89
|
|
90 public int getReadByteCount();
|
|
91
|
|
92 public void resetReadByteCount();
|
|
93
|
|
94 public void setRawSizeLimit(int size);
|
|
95
|
|
96 public void setArraySizeLimit(int size);
|
|
97
|
|
98 public void setMapSizeLimit(int size);
|
|
99 }
|