Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.jms.util
Class SafeUTF

    java.lang.Object
      org.jboss.jms.util.SafeUTF

public class SafeUTF
extends java.lang.Object

A SafeUTF

Version:
  $Revision: 1.1 $ $Id: SafeUTF.java,v 1.1 2006/06/19 15:16:07 timfox Exp $ 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

Field Summary
`static SafeUTF` | `instance`

Constructor Summary
`SafeUTF(int chunkSize)`

Method Summary
`int` | `getLastReadBufferSize()`
`java.lang.String` | `safeReadUTF(java.io.ObjectInput in)`
`void` | `safeWriteUTF(java.io.ObjectOutput out, java.lang.String str)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### instance

    public static SafeUTF instance

Constructor Detail

### SafeUTF

    public SafeUTF(int chunkSize)

Method Detail

### getLastReadBufferSize

    public int getLastReadBufferSize()

### safeWriteUTF

    public void safeWriteUTF(java.io.ObjectOutput out,
                             java.lang.String str)
                      throws java.io.IOException

  Throws:
    `java.io.IOException`

### safeReadUTF

    public java.lang.String safeReadUTF(java.io.ObjectInput in)
                                 throws java.io.IOException

  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 JBoss Inc. All Rights Reserved.