Package org.apache.activemq.util
Class MarshallingSupport
- java.lang.Object
-
- org.apache.activemq.util.MarshallingSupport
-
public final class MarshallingSupport extends Object
The fixed version of the UTF8 encoding function. Some older JVM's UTF8 encoding function breaks when handling large strings.
-
-
Field Summary
Fields Modifier and Type Field Description static byteBIG_STRING_TYPEstatic byteBOOLEAN_TYPEstatic byteBYTE_ARRAY_TYPEstatic byteBYTE_TYPEstatic byteCHAR_TYPEstatic byteDOUBLE_TYPEstatic byteFLOAT_TYPEstatic byteINTEGER_TYPEstatic byteLIST_TYPEstatic byteLONG_TYPEstatic byteMAP_TYPEstatic byteNULLstatic byteSHORT_TYPEstatic byteSTRING_TYPE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringconvertUTF8WithBuf(byte[] buf, char[] out, int offset, int utfSize)From: http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.javastatic longcountUTFBytes(String str)From: http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/DataOutputStream.javastatic voidmarshalBoolean(DataOutputStream out, boolean value)static voidmarshalByte(DataOutputStream out, byte value)static voidmarshalByteArray(DataOutputStream out, byte[] value)static voidmarshalByteArray(DataOutputStream out, byte[] value, int offset, int length)static voidmarshalChar(DataOutputStream out, char value)static voidmarshalDouble(DataOutputStream out, double value)static voidmarshalFloat(DataOutputStream out, float value)static voidmarshalInt(DataOutputStream out, int value)static voidmarshalLong(DataOutputStream out, long value)static voidmarshalNull(DataOutputStream out)static voidmarshalPrimitive(DataOutputStream out, Object value)static voidmarshalPrimitiveList(List<Object> list, DataOutputStream out)static voidmarshalPrimitiveMap(Map<String,Object> map, DataOutputStream out)static voidmarshalShort(DataOutputStream out, short value)static voidmarshalString(DataOutputStream out, String s)static StringpropertiesToString(Properties props)static org.fusesource.hawtbuf.UTF8BufferreadUTF(DataInputStream in, int length)static StringreadUTF8(DataInput dataIn)static PropertiesstringToProperties(String str)static Stringtruncate64(String text)static ObjectunmarshalPrimitive(DataInputStream in)static ObjectunmarshalPrimitive(DataInputStream in, boolean force)static List<Object>unmarshalPrimitiveList(DataInputStream in)static List<Object>unmarshalPrimitiveList(DataInputStream in, boolean force)static Map<String,Object>unmarshalPrimitiveMap(DataInputStream in)static Map<String,Object>unmarshalPrimitiveMap(DataInputStream in, boolean force)static Map<String,Object>unmarshalPrimitiveMap(DataInputStream in, int maxPropertySize)static Map<String,Object>unmarshalPrimitiveMap(DataInputStream in, int maxPropertySize, boolean force)static voidwriteUTF8(DataOutput dataOut, String text)static intwriteUTFBytesToBuffer(String str, long count, byte[] buffer, int offset)From: http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/DataOutputStream.java
-
-
-
Field Detail
-
NULL
public static final byte NULL
- See Also:
- Constant Field Values
-
BOOLEAN_TYPE
public static final byte BOOLEAN_TYPE
- See Also:
- Constant Field Values
-
BYTE_TYPE
public static final byte BYTE_TYPE
- See Also:
- Constant Field Values
-
CHAR_TYPE
public static final byte CHAR_TYPE
- See Also:
- Constant Field Values
-
SHORT_TYPE
public static final byte SHORT_TYPE
- See Also:
- Constant Field Values
-
INTEGER_TYPE
public static final byte INTEGER_TYPE
- See Also:
- Constant Field Values
-
LONG_TYPE
public static final byte LONG_TYPE
- See Also:
- Constant Field Values
-
DOUBLE_TYPE
public static final byte DOUBLE_TYPE
- See Also:
- Constant Field Values
-
FLOAT_TYPE
public static final byte FLOAT_TYPE
- See Also:
- Constant Field Values
-
STRING_TYPE
public static final byte STRING_TYPE
- See Also:
- Constant Field Values
-
BYTE_ARRAY_TYPE
public static final byte BYTE_ARRAY_TYPE
- See Also:
- Constant Field Values
-
MAP_TYPE
public static final byte MAP_TYPE
- See Also:
- Constant Field Values
-
LIST_TYPE
public static final byte LIST_TYPE
- See Also:
- Constant Field Values
-
BIG_STRING_TYPE
public static final byte BIG_STRING_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
marshalPrimitiveMap
public static void marshalPrimitiveMap(Map<String,Object> map, DataOutputStream out) throws IOException
- Throws:
IOException
-
unmarshalPrimitiveMap
public static Map<String,Object> unmarshalPrimitiveMap(DataInputStream in) throws IOException
- Throws:
IOException
-
unmarshalPrimitiveMap
public static Map<String,Object> unmarshalPrimitiveMap(DataInputStream in, boolean force) throws IOException
- Throws:
IOException
-
unmarshalPrimitiveMap
public static Map<String,Object> unmarshalPrimitiveMap(DataInputStream in, int maxPropertySize) throws IOException
- Throws:
IOException
-
unmarshalPrimitiveMap
public static Map<String,Object> unmarshalPrimitiveMap(DataInputStream in, int maxPropertySize, boolean force) throws IOException
- Parameters:
in-- Returns:
- Throws:
IOExceptionIOException
-
marshalPrimitiveList
public static void marshalPrimitiveList(List<Object> list, DataOutputStream out) throws IOException
- Throws:
IOException
-
unmarshalPrimitiveList
public static List<Object> unmarshalPrimitiveList(DataInputStream in) throws IOException
- Throws:
IOException
-
unmarshalPrimitiveList
public static List<Object> unmarshalPrimitiveList(DataInputStream in, boolean force) throws IOException
- Throws:
IOException
-
marshalPrimitive
public static void marshalPrimitive(DataOutputStream out, Object value) throws IOException
- Throws:
IOException
-
unmarshalPrimitive
public static Object unmarshalPrimitive(DataInputStream in) throws IOException
- Throws:
IOException
-
unmarshalPrimitive
public static Object unmarshalPrimitive(DataInputStream in, boolean force) throws IOException
- Throws:
IOException
-
readUTF
public static org.fusesource.hawtbuf.UTF8Buffer readUTF(DataInputStream in, int length) throws IOException
- Throws:
IOException
-
marshalNull
public static void marshalNull(DataOutputStream out) throws IOException
- Throws:
IOException
-
marshalBoolean
public static void marshalBoolean(DataOutputStream out, boolean value) throws IOException
- Throws:
IOException
-
marshalByte
public static void marshalByte(DataOutputStream out, byte value) throws IOException
- Throws:
IOException
-
marshalChar
public static void marshalChar(DataOutputStream out, char value) throws IOException
- Throws:
IOException
-
marshalShort
public static void marshalShort(DataOutputStream out, short value) throws IOException
- Throws:
IOException
-
marshalInt
public static void marshalInt(DataOutputStream out, int value) throws IOException
- Throws:
IOException
-
marshalLong
public static void marshalLong(DataOutputStream out, long value) throws IOException
- Throws:
IOException
-
marshalFloat
public static void marshalFloat(DataOutputStream out, float value) throws IOException
- Throws:
IOException
-
marshalDouble
public static void marshalDouble(DataOutputStream out, double value) throws IOException
- Throws:
IOException
-
marshalByteArray
public static void marshalByteArray(DataOutputStream out, byte[] value) throws IOException
- Throws:
IOException
-
marshalByteArray
public static void marshalByteArray(DataOutputStream out, byte[] value, int offset, int length) throws IOException
- Throws:
IOException
-
marshalString
public static void marshalString(DataOutputStream out, String s) throws IOException
- Throws:
IOException
-
writeUTF8
public static void writeUTF8(DataOutput dataOut, String text) throws IOException
- Throws:
IOException
-
countUTFBytes
public static long countUTFBytes(String str)
From: http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/DataOutputStream.java
-
writeUTFBytesToBuffer
public static int writeUTFBytesToBuffer(String str, long count, byte[] buffer, int offset) throws IOException
From: http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/DataOutputStream.java- Throws:
IOException
-
readUTF8
public static String readUTF8(DataInput dataIn) throws IOException
- Throws:
IOException
-
convertUTF8WithBuf
public static String convertUTF8WithBuf(byte[] buf, char[] out, int offset, int utfSize) throws UTFDataFormatException
From: http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java- Throws:
UTFDataFormatException
-
propertiesToString
public static String propertiesToString(Properties props) throws IOException
- Throws:
IOException
-
stringToProperties
public static Properties stringToProperties(String str) throws IOException
- Throws:
IOException
-
-