java: fixes compile error

This commit is contained in:
frsyuki 2010-05-22 17:05:17 +09:00
parent b9cb270b8f
commit b4fc79c38e
2 changed files with 16 additions and 3 deletions

View File

@ -293,7 +293,7 @@ abstract class BufferedUnpackerImpl extends UnpackerImpl {
return false; return false;
} }
advance(1); advance(1);
return 1; return true;
} }
final boolean unpackBoolean() throws IOException, MessageTypeException { final boolean unpackBoolean() throws IOException, MessageTypeException {
@ -396,6 +396,11 @@ abstract class BufferedUnpackerImpl extends UnpackerImpl {
return bytes; return bytes;
} }
final byte[] unpackByteArray() throws IOException, MessageTypeException {
int length = unpackRaw();
return unpackRawBody(length);
}
final String unpackString() throws IOException, MessageTypeException { final String unpackString() throws IOException, MessageTypeException {
int length = unpackRaw(); int length = unpackRaw();
more(length); more(length);

View File

@ -521,13 +521,21 @@ 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. * This method calls {@link fill()} method if needed.
*/ */
public byte[] unpackRawBody(int length) throws IOException { public byte[] unpackRawBody(int length) throws IOException {
return impl.unpackRawBody(length); return impl.unpackRawBody(length);
} }
/**
* 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. * Gets one {@code String} value from the buffer.
* This method calls {@link fill()} method if needed. * This method calls {@link fill()} method if needed.
@ -546,7 +554,7 @@ public class Unpacker implements Iterable<Object> {
} }
final void unpack(MessageUnpackable obj) throws IOException, MessageTypeException { final void unpack(MessageUnpackable obj) throws IOException, MessageTypeException {
obj.unpackMessage(this); obj.messageUnpack(this);
} }
final boolean tryUnpackNull() throws IOException { final boolean tryUnpackNull() throws IOException {