diff options
| author | frsyuki <frsyuki@users.sourceforge.jp> | 2010-05-22 17:05:17 +0900 |
|---|---|---|
| committer | frsyuki <frsyuki@users.sourceforge.jp> | 2010-05-22 17:05:17 +0900 |
| commit | b4fc79c38ee44a1da5c2973fa213753a2d309666 (patch) | |
| tree | 4597ef627ebcbdb2eb7ab9f3459d5bce1b8c0adc /java/src | |
| parent | b9cb270b8f771e5504e36469112daa6a32b24d63 (diff) | |
| download | msgpack-python-b4fc79c38ee44a1da5c2973fa213753a2d309666.tar.gz | |
java: fixes compile error
Diffstat (limited to 'java/src')
| -rw-r--r-- | java/src/main/java/org/msgpack/BufferedUnpackerImpl.java | 7 | ||||
| -rw-r--r-- | java/src/main/java/org/msgpack/Unpacker.java | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/java/src/main/java/org/msgpack/BufferedUnpackerImpl.java b/java/src/main/java/org/msgpack/BufferedUnpackerImpl.java index 4b2f302..cc6604d 100644 --- a/java/src/main/java/org/msgpack/BufferedUnpackerImpl.java +++ b/java/src/main/java/org/msgpack/BufferedUnpackerImpl.java @@ -293,7 +293,7 @@ abstract class BufferedUnpackerImpl extends UnpackerImpl { return false; } advance(1); - return 1; + return true; } final boolean unpackBoolean() throws IOException, MessageTypeException { @@ -396,6 +396,11 @@ abstract class BufferedUnpackerImpl extends UnpackerImpl { return bytes; } + final byte[] unpackByteArray() throws IOException, MessageTypeException { + int length = unpackRaw(); + return unpackRawBody(length); + } + final String unpackString() throws IOException, MessageTypeException { int length = unpackRaw(); more(length); diff --git a/java/src/main/java/org/msgpack/Unpacker.java b/java/src/main/java/org/msgpack/Unpacker.java index 1917b9f..e84aff9 100644 --- a/java/src/main/java/org/msgpack/Unpacker.java +++ b/java/src/main/java/org/msgpack/Unpacker.java @@ -521,7 +521,7 @@ public class Unpacker implements Iterable<Object> { } /** - * Gets one raw header from the buffer. + * Gets one raw body from the buffer. * This method calls {@link fill()} method if needed. */ public byte[] unpackRawBody(int length) throws IOException { @@ -529,6 +529,14 @@ public class Unpacker implements Iterable<Object> { } /** + * Gets one raw bytes from the buffer. + * This method calls {@link fill()} method if needed. + */ + public byte[] unpackByteArray() throws IOException { + return impl.unpackByteArray(); + } + + /** * Gets one {@code String} value from the buffer. * This method calls {@link fill()} method if needed. * @throws MessageTypeException the first value of the buffer is not a {@code String}. @@ -546,7 +554,7 @@ public class Unpacker implements Iterable<Object> { } final void unpack(MessageUnpackable obj) throws IOException, MessageTypeException { - obj.unpackMessage(this); + obj.messageUnpack(this); } final boolean tryUnpackNull() throws IOException { |
