Update to string record

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352823 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Glen Stampoultzis 2002-08-05 12:53:01 +00:00
parent 3b6f854e14
commit 0ad7523480

View File

@ -54,8 +54,9 @@
package org.apache.poi.hssf.record;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.*;
import java.io.IOException;
/**
* Supports the STRING record structure.
@ -123,7 +124,6 @@ public class StringRecord
* @param size size of data
* @param offset of the record's data (provided a big array of the file)
*/
protected void fillFields( byte[] data, short size, int offset )
{
field_1_string_length = LittleEndian.getUShort(data, 0 + offset);
@ -134,7 +134,7 @@ public class StringRecord
}
else
{
field_3_string = new String(data, 3 + offset, getStringLength());
field_3_string = new String(data, 3 + offset, field_1_string_length);
}
}
@ -156,7 +156,6 @@ public class StringRecord
return 4 + 2 + 1 + getStringByteLength();
}
/**
* is this uncompressed unicode (16bit)? Or just 8-bit compressed?
* @return isUnicode - True for 16bit- false for 8bit
@ -178,7 +177,7 @@ public class StringRecord
public int serialize( int offset, byte[] data )
{
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(data, 2 + offset, ( short ) (2 + getStringByteLength()));
LittleEndian.putShort(data, 2 + offset, ( short ) (3 + getStringByteLength()));
LittleEndian.putUShort(data, 4 + offset, field_1_string_length);
data[6 + offset] = field_2_unicode_flag;
if (isUnCompressedUnicode())