--- StringUtil.java.sav 2005-05-15 14:58:16.000000000 +0100 +++ StringUtil.java 2005-05-15 15:07:37.000000000 +0100 @@ -39,8 +39,9 @@ } /** - * given a byte array of 16-bit unicode characters, compress to 8-bit and - * return a string + * Given a byte array of 16-bit unicode characters in Little Endian + * format (most important byte last), return a Java String representation + * of it. (In Excel terms, compress to 8-bit and return a string) * * { 0x16, 0x00 } -0x16 * @@ -77,8 +78,9 @@ } /** - * given a byte array of 16-bit unicode characters, compress to 8-bit and - * return a string + * Given a byte array of 16-bit unicode characters in little endian + * format (most important byte last), return a Java String representation + * of it. (In Excel terms, compress to 8-bit and return a string) * * { 0x16, 0x00 } -0x16 * @@ -90,8 +92,9 @@ } /** - * given a byte array of 16-bit unicode characters, compress to 8-bit and - * return a string + * Given a byte array of 16-bit unicode characters in big endian + * format (most important byte first), return a Java String representation + * of it. (In Excel terms, compress to 8-bit and return a string) * * { 0x00, 0x16 } -0x16 * @@ -127,8 +130,9 @@ } /** - * given a byte array of 16-bit unicode characters, compress to 8-bit and - * return a string + * Given a byte array of 16-bit unicode characters in big endian + * format (most important byte first), return a Java String representation + * of it. (In Excel terms, compress to 8-bit and return a string) * * { 0x00, 0x16 } -0x16 * @@ -140,7 +144,9 @@ } /** - * read compressed unicode(8bit) + * Read 8 bit data (in ISO-8859-1 codepage) into a (unicode) Java + * String and return. + * (In Excel terms, read compressed 8 bit unicode as a string) * * @param string byte array to read * @param offset offset to read byte array @@ -158,8 +164,10 @@ } } - /** - * write compressed unicode + /** + * Takes a unicode string, and returns it as 8 bit data (in ISO-8859-1 + * codepage). + * (In Excel terms, write compressed 8 bit unicode) * *@param input the String containing the data to be written *@param output the byte array to which the data is to be written @@ -179,10 +187,12 @@ } /** - * Write uncompressed unicode + * Takes a unicode string, and returns it as little endian (most + * important byte last) bytes in the supplied byte array. + * (In Excel terms, write uncompressed unicode) * *@param input the String containing the unicode data to be written - *@param output the byte array to hold the uncompressed unicode + *@param output the byte array to hold the uncompressed unicode, should be twice the length of the String *@param offset the offset to start writing into the byte array */ public static void putUnicodeLE( @@ -198,10 +208,12 @@ } /** - * Write uncompressed unicode + * Takes a unicode string, and returns it as big endian (most + * important byte first) bytes in the supplied byte array. + * (In Excel terms, write uncompressed unicode) * *@param input the String containing the unicode data to be written - *@param output the byte array to hold the uncompressed unicode + *@param output the byte array to hold the uncompressed unicode, should be twice the length of the String *@param offset the offset to start writing into the byte array */ public static void putUnicodeBE( @@ -321,9 +333,10 @@ } /** - * @param format - * @return true if string needs Unicode to be represented. - */ + * Checks to see if a given String needs to be represented as Unicode + * @param value + * @return true if string needs Unicode to be represented. + */ public static boolean isUnicodeString(final String value) { try { return !value.equals(new String(value.getBytes("ISO-8859-1"), "ISO-8859-1"));