org.jboss.messaging.util
Class SafeUTF
java.lang.Object
org.jboss.messaging.util.SafeUTF
- public class SafeUTF
- extends java.lang.Object
A SafeUTF
- Version:
- $Revision: 1174 $
$Id: SafeUTF.java 1174 2006-08-02 14:14:32Z timfox $
There is a "bug" in JDK1.4 / 1.5 DataOutputStream.writeUTF()
which means it does not work with Strings >= 64K serialized size.
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4806007
We work around this by chunking larger strings into smaller pieces.
Note we only support TextMessage and ObjectMessage bodies with serialized length >= 64K
We DO NOT support Strings written to BytesMessages or StreamMessages or written as keys or values
in MapMessages, or as String properties or other String fields having serialized length >= 64K
This is for performance reasons since there is an overhead in coping with large
Strings
- Author:
- Tim Fox, Adrian Brock
Constructor Summary |
SafeUTF(int chunkSize)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
instance
public static SafeUTF instance
SafeUTF
public SafeUTF(int chunkSize)
getLastReadBufferSize
public int getLastReadBufferSize()
safeWriteUTF
public void safeWriteUTF(java.io.DataOutputStream out,
java.lang.String str)
throws java.io.IOException
- Throws:
java.io.IOException
safeReadUTF
public java.lang.String safeReadUTF(java.io.DataInputStream in)
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2006 JBoss Inc. All Rights Reserved.