Bug fixed in writing Unicode strings.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353328 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Rainer Klute 2003-09-01 05:45:36 +00:00
parent 2245df361f
commit 1a25977197

View File

@ -348,7 +348,7 @@ public class VariantSupport extends Variant
case Variant.VT_LPWSTR:
{
final int nrOfChars = ((String) value).length() + 1;
TypeWriter.writeUIntToStream(out, nrOfChars);
length += TypeWriter.writeUIntToStream(out, nrOfChars);
char[] s = Util.pad4((String) value);
for (int i = 0; i < s.length; i++)
{
@ -358,8 +358,8 @@ public class VariantSupport extends Variant
final byte lowb = (byte) low;
out.write(lowb);
out.write(highb);
length += 2;
}
length = nrOfChars * 2;
out.write(0x00);
out.write(0x00);
length += 2;
@ -386,8 +386,7 @@ public class VariantSupport extends Variant
}
case Variant.VT_I4:
{
TypeWriter.writeToStream(out, ((Long) value).intValue());
length = LittleEndianConsts.INT_SIZE;
length += TypeWriter.writeToStream(out, ((Long) value).intValue());
break;
}
case Variant.VT_FILETIME: