This interface is preserved only for backwards compatibility and
is being phased out in favor of specific data types. The only
remaining place where it must be used is in the
Topics.fetch
interface. In all other cases
its use should be avoided - use the superinterface in preference.
@Deprecated public interface Content extends Bytes
Content can represent the value of a topic. Content may also form the body of a message received from a client.
Modifier and Type | Method and Description |
---|---|
String |
asString()
Deprecated.
Returns the content as a String.
|
byte[] |
toBytes()
Deprecated.
Return the content as an array of bytes.
|
asInputStream, copyTo, length, toByteArray
byte[] toBytes()
This actually returns the internal byte array which must not be altered. If this data is to be manipulated in any way, it must first be copied.
String asString()
The byte content is converted to a String using the UTF-8 character set.
Copyright © 2020 Push Technology Ltd. All Rights Reserved.