public final class Converter extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
deserialise(byte[] bytes,
Class<T> type)
Deserialises an object from a
byte[] using an ObjectInputStream. |
static <T> T |
deserialiseFromBase64(byte[] bytes,
Class<T> type)
Deserialises the given base64 encoded
bate[] to the desired Object. |
static <T> T |
deserialiseFromGzip(byte[] bytes,
Class<T> type)
DOCUMENT ME!
|
static <T> T |
deserialiseFromString(String s,
Class<T> type,
boolean compressionEnabled)
Creates an
Object from an ASCII encoded String. |
static byte[] |
fromBase64(byte[] bytes)
Decodes the given
byte[] from base64. |
static byte[] |
fromString(String bytes)
Create a
byte[] from the given String. |
static byte[] |
serialise(Object o)
Serialises an object into a
byte[] using an ObjectOutputStream. |
static byte[] |
serialiseToBase64(Object o)
Serialises the given
Object to a base64 encoded byte[]. |
static byte[] |
serialiseToGzip(Object o)
DOCUMENT ME!
|
static String |
serialiseToString(Object o,
boolean compressionEnabled)
Creates an ASCII encoded
String from an Object. |
static byte[] |
toBase64(byte[] bytes)
Encodes the given
byte[] to base64. |
static String |
toString(byte[] bytes)
Create a
String from a given byte[]. |
public static byte[] serialise(Object o) throws IOException
byte[] using an ObjectOutputStream.o - the object to serialisebyte[]IOException - if an error occurs during serialisationpublic static <T> T deserialise(byte[] bytes,
Class<T> type)
throws IOException,
ClassNotFoundException
byte[] using an ObjectInputStream.T - the type of the resulting Objectbytes - the serialised byte[]type - the Class of the resulting Objectnull if the given byte[] is nullIOException - if an error occurs during deserialisationClassNotFoundException - if any of the classes of the object cannot be foundpublic static byte[] serialiseToBase64(Object o) throws IOException
Object to a base64 encoded byte[].o - the Object to serialisebyte[]IOException - if any error occurs during serialisationtoBase64(byte[]),
serialise(java.lang.Object)public static <T> T deserialiseFromBase64(byte[] bytes,
Class<T> type)
throws IOException,
ClassNotFoundException
bate[] to the desired Object.T - the type of the resulting Objectbytes - the serialised base64 encoded byte[]type - the Class of the resulting ObjectObject or null if the given byte[] is
nullIOException - if an error occurs during deserialisationClassNotFoundException - if any of the classes of the object cannot be founddeserialise(byte[], java.lang.Class),
fromBase64(byte[])public static byte[] toBase64(byte[] bytes)
byte[] to base64.bytes - bytes to encodeBase64.encodeBase64(byte[])public static byte[] fromBase64(byte[] bytes)
byte[] from base64.bytes - bytes to decodenull if the given byte[] is nullBase64.decodeBase64(byte[])public static String toString(byte[] bytes)
String from a given byte[]. The given bytes will be base64 encoded and the
resulting String will have ASCII encoding.bytes - the bytes that shall be represented as StringStringIllegalStateException - if the system does not support ASCII encodingtoBase64(byte[])public static byte[] fromString(String bytes)
byte[] from the given String. The given String is supposed to be ASCII
encoded.bytes - the String to be convertedbyte[] or null if the given String is
nullIllegalStateException - if the system does not support ASCII encodingfromBase64(byte[])public static String serialiseToString(Object o, boolean compressionEnabled) throws IOException
String from an Object.o - the object to serialisecompressionEnabled - DOCUMENT ME!String representation of an ObjectIOException - if any error occurs during serialisationtoString(byte[]),
serialise(java.lang.Object)public static <T> T deserialiseFromString(String s, Class<T> type, boolean compressionEnabled) throws IOException, ClassNotFoundException
Object from an ASCII encoded String.T - the type of the Object to be createds - the ASCII encoded String representation of an Objecttype - the type class fo the Object to be createdcompressionEnabled - DOCUMENT ME!Object create from the ASCII encoded String or null if the
given String is nullIOException - if any error occurs during deserialisationClassNotFoundException - if the desired Class cannot be founddeserialise(byte[], java.lang.Class),
fromString(java.lang.String)public static <T> T deserialiseFromGzip(byte[] bytes,
Class<T> type)
throws IOException,
ClassNotFoundException
T - DOCUMENT ME!bytes - DOCUMENT ME!type - DOCUMENT ME!IOException - DOCUMENT ME!ClassNotFoundException - DOCUMENT ME!public static byte[] serialiseToGzip(Object o) throws IOException
o - DOCUMENT ME!IOException - DOCUMENT ME!Copyright © 2012–2026 cismet GmbH. All rights reserved.