Package org.apache.activemq.util
Class MarshallingSupport
java.lang.Object
org.apache.activemq.util.MarshallingSupport
The fixed version of the UTF8 encoding function. Some older JVM's UTF8
encoding function breaks when handling large strings.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertUTF8WithBuf
(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 long
countUTFBytes
(String str) From: http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/DataOutputStream.javastatic void
marshalBoolean
(DataOutputStream out, boolean value) static void
marshalByte
(DataOutputStream out, byte value) static void
marshalByteArray
(DataOutputStream out, byte[] value) static void
marshalByteArray
(DataOutputStream out, byte[] value, int offset, int length) static void
marshalChar
(DataOutputStream out, char value) static void
marshalDouble
(DataOutputStream out, double value) static void
marshalFloat
(DataOutputStream out, float value) static void
marshalInt
(DataOutputStream out, int value) static void
marshalLong
(DataOutputStream out, long value) static void
static void
marshalPrimitive
(DataOutputStream out, Object value) static void
marshalPrimitiveList
(List<Object> list, DataOutputStream out) static void
marshalPrimitiveMap
(Map<String, Object> map, DataOutputStream out) static void
marshalShort
(DataOutputStream out, short value) static void
marshalString
(DataOutputStream out, String s) static String
propertiesToString
(Properties props) static org.fusesource.hawtbuf.UTF8Buffer
readUTF
(DataInputStream in, int length) static String
static Properties
stringToProperties
(String str) static String
truncate64
(String text) static Object
static Object
unmarshalPrimitive
(DataInputStream in, boolean force) unmarshalPrimitiveList
(DataInputStream in, boolean force) unmarshalPrimitiveMap
(DataInputStream in, boolean force) unmarshalPrimitiveMap
(DataInputStream in, int maxPropertySize) unmarshalPrimitiveMap
(DataInputStream in, int maxPropertySize, boolean force) static void
writeUTF8
(DataOutput dataOut, String text) static int
writeUTFBytesToBuffer
(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 Details
-
NULL
public static final byte NULL- See Also:
-
BOOLEAN_TYPE
public static final byte BOOLEAN_TYPE- See Also:
-
BYTE_TYPE
public static final byte BYTE_TYPE- See Also:
-
CHAR_TYPE
public static final byte CHAR_TYPE- See Also:
-
SHORT_TYPE
public static final byte SHORT_TYPE- See Also:
-
INTEGER_TYPE
public static final byte INTEGER_TYPE- See Also:
-
LONG_TYPE
public static final byte LONG_TYPE- See Also:
-
DOUBLE_TYPE
public static final byte DOUBLE_TYPE- See Also:
-
FLOAT_TYPE
public static final byte FLOAT_TYPE- See Also:
-
STRING_TYPE
public static final byte STRING_TYPE- See Also:
-
BYTE_ARRAY_TYPE
public static final byte BYTE_ARRAY_TYPE- See Also:
-
MAP_TYPE
public static final byte MAP_TYPE- See Also:
-
LIST_TYPE
public static final byte LIST_TYPE- See Also:
-
BIG_STRING_TYPE
public static final byte BIG_STRING_TYPE- See Also:
-
-
Method Details
-
marshalPrimitiveMap
public static void marshalPrimitiveMap(Map<String, Object> map, DataOutputStream out) throws IOException- Throws:
IOException
-
unmarshalPrimitiveMap
- 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:
IOException
IOException
-
marshalPrimitiveList
- Throws:
IOException
-
unmarshalPrimitiveList
- Throws:
IOException
-
unmarshalPrimitiveList
public static List<Object> unmarshalPrimitiveList(DataInputStream in, boolean force) throws IOException - Throws:
IOException
-
marshalPrimitive
- Throws:
IOException
-
unmarshalPrimitive
- Throws:
IOException
-
unmarshalPrimitive
- Throws:
IOException
-
readUTF
public static org.fusesource.hawtbuf.UTF8Buffer readUTF(DataInputStream in, int length) throws IOException - Throws:
IOException
-
marshalNull
- Throws:
IOException
-
marshalBoolean
- Throws:
IOException
-
marshalByte
- Throws:
IOException
-
marshalChar
- Throws:
IOException
-
marshalShort
- Throws:
IOException
-
marshalInt
- Throws:
IOException
-
marshalLong
- Throws:
IOException
-
marshalFloat
- Throws:
IOException
-
marshalDouble
- Throws:
IOException
-
marshalByteArray
- Throws:
IOException
-
marshalByteArray
public static void marshalByteArray(DataOutputStream out, byte[] value, int offset, int length) throws IOException - Throws:
IOException
-
marshalString
- Throws:
IOException
-
writeUTF8
- Throws:
IOException
-
countUTFBytes
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
- 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
- Throws:
IOException
-
stringToProperties
- Throws:
IOException
-
truncate64
-