Package com.thingworx.common.utils
Class StreamUtilities
java.lang.Object
com.thingworx.common.utils.StreamUtilities
@ThingworxExtensionApiClass(since={6,6},
canInstantiate=true)
public final class StreamUtilities
extends Object
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
booleanToBytes
(boolean value) static ByteArrayInputStream
byteArrayToStream
(byte[] data) static byte[]
doubleToBytes
(double value) static byte[]
integerToBytes
(int value) static byte[]
longToBytes
(long value) static byte[]
readStreamToByteArray
(InputStream stream) static String
readStreamToString
(InputStream stream) static byte[]
stringToBytes
(String value)
-
Constructor Details
-
StreamUtilities
public StreamUtilities()
-
-
Method Details
-
byteArrayToStream
@ThingworxExtensionApiMethod(since={6,6}) public static ByteArrayInputStream byteArrayToStream(byte[] data) -
integerToBytes
-
longToBytes
-
doubleToBytes
-
booleanToBytes
-
stringToBytes
-
readStreamToByteArray
@ThingworxExtensionApiMethod(since={6,6}) public static byte[] readStreamToByteArray(InputStream stream) throws Exception - Throws:
Exception
- If an error occurs
-
readStreamToString
@ThingworxExtensionApiMethod(since={6,6}) public static String readStreamToString(InputStream stream) throws Exception - Throws:
Exception
- If an error occurs
-