ObjectUtils
Path
com.roma.apic.livedata.common.v1.ObjectUtils
Description
This class is used to serialize a Java object into a byte array or deserialize a Java object from a byte array.
Example
1 2 3 4 5 6 |
importClass(com.roma.apic.livedata.common.v1.ObjectUtils);
function execute(data) {
var sourceCode = "Hello world";
var bytes = ObjectUtils.getBytes(sourceCode);
return ObjectUtils.getObjectFromBytes(bytes)
}
|
Method List
|
Returned Type |
Method and Description |
|---|---|
|
static byte[] |
getBytes(Object obj) Serialize objects into byte arrays. |
|
static Object |
getObjectFromBytes(byte[] objBytes) Deserialize byte arrays into objects. |
|
static int |
size(Object obj) Obtains the size of an object. |
Method Details
- public static byte[] getBytes(Object obj)
Serialize objects into byte arrays.
Input Parameter
obj indicates an object.
Returns
Byte array serialized from an object.
- public static Object getObjectFromBytes(byte[] objBytes)
Deserialize byte arrays into objects.
Input Parameter
objBytes indicates a byte array.
Returns
Serialized object.
- public static int size(Object obj)
Obtain the size of an object.
Input Parameter
obj indicates an object.
Returns
Size of the object.
Last Article: Md5Utils
Next Article: QueueConfig
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.