cziegeler 01/07/02 07:22:54 Modified: src/org/apache/cocoon/components/sax Tag: cocoon_20_branch XMLByteStreamCompiler.java Log: Fixed inconsistencies reported several weeks ago by Santiago Gala Revision Changes Path No revision No revision 1.1.1.1.2.1 +5 -4 xml-cocoon2/src/org/apache/cocoon/components/sax/XMLByteStreamCompiler.java Index: XMLByteStreamCompiler.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/sax/XMLByteStreamCompiler.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- XMLByteStreamCompiler.java 2001/05/09 20:49:58 1.1.1.1 +++ XMLByteStreamCompiler.java 2001/07/02 14:22:50 1.1.1.1.2.1 @@ -22,7 +22,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a> * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Revision: 1.1.1.1 $ $Date: 2001/05/09 20:49:58 $ + * @version CVS $Revision: 1.1.1.1.2.1 $ $Date: 2001/07/02 14:22:50 $ */ public final class XMLByteStreamCompiler @@ -219,7 +219,6 @@ if (index == null) { int length = str.length(); map.put(str, new Integer(count++)); - if (length > (2 << 15)) throw new SAXException("String cannot be bigger than 32K"); this.writeChars(str.toCharArray(), 0, length); } else { int i = index.intValue(); @@ -228,7 +227,8 @@ } } - public final void writeChars(char[] ch, int start, int length) throws SAXException { + public final void writeChars(char[] ch, int start, int length) + throws SAXException { int utflen = 0; int c, count = 0; @@ -243,7 +243,8 @@ } } - if (utflen > 65535) throw new SAXException("UTFDataFormatException"); + if (utflen > 0x00007FFF) + throw new SAXException("UTFDataFormatException: String cannot be longer than 32k."); byte[] bytearr = new byte[utflen+2]; bytearr[count++] = (byte) ((utflen >>> 8) & 0xFF); ---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]