Package org.msgpack.value
Interface RawValue
-
- All Superinterfaces:
Value
- All Known Subinterfaces:
BinaryValue
,ImmutableBinaryValue
,ImmutableRawValue
,ImmutableStringValue
,StringValue
- All Known Implementing Classes:
AbstractImmutableRawValue
,ImmutableBinaryValueImpl
,ImmutableStringValueImpl
public interface RawValue extends Value
Base interface ofStringValue
andBinaryValue
interfaces. MessagePack's Raw type can represent a byte array at most 264-1 bytes.- See Also:
StringValue
,BinaryValue
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
asByteArray()
Returns the value asbyte[]
.java.nio.ByteBuffer
asByteBuffer()
Returns the value asByteBuffer
.java.lang.String
asString()
Returns the value asString
.java.lang.String
toString()
Returns the value asString
.-
Methods inherited from interface org.msgpack.value.Value
asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, equals, getValueType, immutableValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, toJson, writeTo
-
-
-
-
Method Detail
-
asByteArray
byte[] asByteArray()
Returns the value asbyte[]
. This method copies the byte array.
-
asByteBuffer
java.nio.ByteBuffer asByteBuffer()
Returns the value asByteBuffer
. Returned ByteBuffer is read-only. See alsoByteBuffer.asReadOnlyBuffer()
. This method doesn't copy the byte array as much as possible.
-
asString
java.lang.String asString()
Returns the value asString
. This method throws an exception if the value includes invalid UTF-8 byte sequence.- Throws:
MessageStringCodingException
- If this value includes invalid UTF-8 byte sequence.
-
toString
java.lang.String toString()
Returns the value asString
. This method replaces an invalid UTF-8 byte sequence withU+FFFD replacement character
.- Overrides:
toString
in classjava.lang.Object
-
-