User: starksm Date: 01/09/30 23:31:58 Modified: src/main/org/jboss/mq Tag: Branch_2_4 SpyTextMessage.java Log: Undo the hacky fix for bug 462253 Revision Changes Path No revision No revision 1.2.2.3 +4 -39 jbossmq/src/main/org/jboss/mq/SpyTextMessage.java Index: SpyTextMessage.java =================================================================== RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/SpyTextMessage.java,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -u -r1.2.2.2 -r1.2.2.3 --- SpyTextMessage.java 2001/09/18 21:02:38 1.2.2.2 +++ SpyTextMessage.java 2001/10/01 06:31:58 1.2.2.3 @@ -7,7 +7,6 @@ package org.jboss.mq; import java.io.*; -import java.util.ArrayList; import javax.jms.JMSException; import javax.jms.MessageNotWriteableException; @@ -18,7 +17,7 @@ * * @author Norbert Lataille ([EMAIL PROTECTED]) * @created August 16, 2001 - * @version $Revision: 1.2.2.2 $ + * @version $Revision: 1.2.2.3 $ */ public class SpyTextMessage extends SpyMessage @@ -29,8 +28,7 @@ String content = null; private final static long serialVersionUID = 235726945332013953L; - private final static int chunkSize = 16384; - + // Public -------------------------------------------------------- public void setText( String string ) @@ -67,17 +65,7 @@ if ( type == NULL ) { content = null; } else { - // apply workaround for string > 64K bug in jdk's 1.3.* - - // Read the no. of chunks this message is split into, allocate - // a StringBuffer that can hold all chunks, read the chunks - // into the buffer and set 'content' accordingly - int chunksToRead = in.readInt(); - StringBuffer sb = new StringBuffer(chunkSize * chunksToRead); - for (int i = 0; i < chunksToRead; i++) { - sb.append( in.readUTF() ); - } - content = sb.toString(); + content = in.readUTF(); } } @@ -87,31 +75,8 @@ if ( content == null ) { out.writeByte( NULL ); } else { - // apply workaround for string > 64K bug in jdk's 1.3.* - - // Split content into chunks of size 'chunkSize' and assemble - // the pieces into a Vector ... - ArrayList v = new ArrayList(); - int contentLength = content.length(); - - while (contentLength > 0) { - int beginCopy = (v.size()) * chunkSize; - int endCopy = contentLength <= chunkSize ? - beginCopy + contentLength : beginCopy + chunkSize; - - String theChunk = content.substring(beginCopy, endCopy); - v.add(theChunk); - - contentLength -= chunkSize; - } - - // Write out the type (OBJECT), the no. of chunks and finally - // all chunks that have been assembled previously out.writeByte( OBJECT ); - out.writeInt(v.size()); - for (int i = 0; i < v.size(); i++) { - out.writeUTF( (String)v.get(i) ); - } + out.writeUTF( content ); } }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development