44914 - Fix/suppress warning message - WARN. Unread n bytes of record 0xNN
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@652446 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
993bf57633
commit
63a52cf21d
@ -37,6 +37,7 @@
|
||||
|
||||
<!-- Don't forget to update status.xml too! -->
|
||||
<release version="3.1-beta2" date="2008-05-??">
|
||||
<action dev="POI-DEVELOPERS" type="fix">44914 - Fix/suppress warning message "WARN. Unread n bytes of record 0xNN"</action>
|
||||
<action dev="POI-DEVELOPERS" type="fix">44892 - made HSSFWorkbook.getSheet(String) case insensitive</action>
|
||||
<action dev="POI-DEVELOPERS" type="fix">44886] - Correctly process PICT metafile in EscherMetafileBlip</action>
|
||||
<action dev="POI-DEVELOPERS" type="fix">44893 - Correctly handle merged regions in HSSFSheet.autoSizeColumn</action>
|
||||
|
@ -34,6 +34,7 @@
|
||||
<!-- Don't forget to update changes.xml too! -->
|
||||
<changes>
|
||||
<release version="3.1-beta2" date="2008-05-??">
|
||||
<action dev="POI-DEVELOPERS" type="fix">44914 - Fix/suppress warning message "WARN. Unread n bytes of record 0xNN"</action>
|
||||
<action dev="POI-DEVELOPERS" type="fix">44892 - made HSSFWorkbook.getSheet(String) case insensitive</action>
|
||||
<action dev="POI-DEVELOPERS" type="fix">44886] - Correctly process PICT metafile in EscherMetafileBlip</action>
|
||||
<action dev="POI-DEVELOPERS" type="fix">44893 - Correctly handle merged regions in HSSFSheet.autoSizeColumn</action>
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/* ====================================================================
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
@ -16,12 +15,6 @@
|
||||
limitations under the License.
|
||||
==================================================================== */
|
||||
|
||||
|
||||
/*
|
||||
* ColumnInfoRecord.java
|
||||
*
|
||||
* Created on December 8, 2001, 8:44 AM
|
||||
*/
|
||||
package org.apache.poi.hssf.record;
|
||||
|
||||
import org.apache.poi.util.LittleEndian;
|
||||
@ -29,29 +22,28 @@ import org.apache.poi.util.BitField;
|
||||
import org.apache.poi.util.BitFieldFactory;
|
||||
|
||||
/**
|
||||
* Title: ColumnInfo Record<P>
|
||||
* Description: Defines with width and formatting for a range of columns<P>
|
||||
* REFERENCE: PG 293 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P>
|
||||
* Title: COLINFO Record<p/>
|
||||
* Description: Defines with width and formatting for a range of columns<p/>
|
||||
* REFERENCE: PG 293 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<p/>
|
||||
* @author Andrew C. Oliver (acoliver at apache dot org)
|
||||
* @version 2.0-pre
|
||||
*/
|
||||
|
||||
public class ColumnInfoRecord
|
||||
extends Record
|
||||
{
|
||||
public final class ColumnInfoRecord extends Record {
|
||||
public static final short sid = 0x7d;
|
||||
private short field_1_first_col;
|
||||
private short field_2_last_col;
|
||||
private short field_3_col_width;
|
||||
private short field_4_xf_index;
|
||||
private short field_5_options;
|
||||
static final private BitField hidden = BitFieldFactory.getInstance(0x01);
|
||||
static final private BitField outlevel = BitFieldFactory.getInstance(0x0700);
|
||||
static final private BitField collapsed = BitFieldFactory.getInstance(0x1000);
|
||||
private static final BitField hidden = BitFieldFactory.getInstance(0x01);
|
||||
private static final BitField outlevel = BitFieldFactory.getInstance(0x0700);
|
||||
private static final BitField collapsed = BitFieldFactory.getInstance(0x1000);
|
||||
// Excel seems write values 2, 10, and 260, even though spec says "must be zero"
|
||||
private short field_6_reserved;
|
||||
|
||||
public ColumnInfoRecord()
|
||||
{
|
||||
field_6_reserved = 2; // seems to be the most common value
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,7 +63,18 @@ public class ColumnInfoRecord
|
||||
field_3_col_width = in.readShort();
|
||||
field_4_xf_index = in.readShort();
|
||||
field_5_options = in.readShort();
|
||||
field_6_reserved = in.readShort();
|
||||
switch(in.remaining()) {
|
||||
case 2: // usual case
|
||||
field_6_reserved = in.readShort();
|
||||
break;
|
||||
case 1:
|
||||
// often COLINFO gets encoded 1 byte short
|
||||
// shouldn't matter because this field is unused
|
||||
field_6_reserved = in.readByte();
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Unusual record size remaining=(" + in.remaining() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
protected void validateSid(short id)
|
||||
|
@ -15,30 +15,25 @@
|
||||
limitations under the License.
|
||||
==================================================================== */
|
||||
|
||||
|
||||
package org.apache.poi.hssf.record;
|
||||
|
||||
import org.apache.poi.util.LittleEndian;
|
||||
import org.apache.poi.util.POILogFactory;
|
||||
import org.apache.poi.util.POILogger;
|
||||
import org.apache.poi.util.StringUtil;
|
||||
|
||||
/**
|
||||
* Title: FileSharing<P>
|
||||
* Title: FILESHARING<P>
|
||||
* Description: stores the encrypted readonly for a workbook (write protect)
|
||||
* REFERENCE: PG 314 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P>
|
||||
* This functionality is accessed from the options dialog box available when performing 'Save As'.<p/>
|
||||
* REFERENCE: PG 314 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<p/>
|
||||
* @author Andrew C. Oliver (acoliver at apache dot org)
|
||||
*/
|
||||
|
||||
public class FileSharingRecord extends Record {
|
||||
private static POILogger logger = POILogFactory.getLogger(FileSharingRecord.class);
|
||||
public final class FileSharingRecord extends Record {
|
||||
|
||||
public final static short sid = 0x5b;
|
||||
private short field_1_readonly;
|
||||
private short field_2_password;
|
||||
private byte field_3_username_length;
|
||||
private short field_4_unknown; // not documented
|
||||
private String field_5_username;
|
||||
private byte field_3_username_unicode_options;
|
||||
private String field_3_username_value;
|
||||
|
||||
public FileSharingRecord() {}
|
||||
|
||||
@ -61,23 +56,15 @@ public class FileSharingRecord extends Record {
|
||||
protected void fillFields(RecordInputStream in) {
|
||||
field_1_readonly = in.readShort();
|
||||
field_2_password = in.readShort();
|
||||
field_3_username_length = in.readByte();
|
||||
|
||||
// Is this really correct? The latest docs
|
||||
// seem to hint there's nothing between the
|
||||
// username length and the username string
|
||||
field_4_unknown = in.readShort();
|
||||
int nameLen = in.readShort();
|
||||
|
||||
// Ensure we don't try to read more data than
|
||||
// there actually is
|
||||
if(field_3_username_length > in.remaining()) {
|
||||
logger.log(POILogger.WARN, "FileSharingRecord defined a username of length " + field_3_username_length + ", but only " + in.remaining() + " bytes were left, truncating");
|
||||
field_3_username_length = (byte)in.remaining();
|
||||
}
|
||||
if(field_3_username_length > 0) {
|
||||
field_5_username = in.readCompressedUnicode(field_3_username_length);
|
||||
if(nameLen > 0) {
|
||||
// TODO - Current examples(3) from junits only have zero length username.
|
||||
field_3_username_unicode_options = in.readByte();
|
||||
field_3_username_value = in.readCompressedUnicode(nameLen);
|
||||
} else {
|
||||
field_5_username = "";
|
||||
field_3_username_value = "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,45 +122,24 @@ public class FileSharingRecord extends Record {
|
||||
/**
|
||||
* @returns byte representing the length of the username field
|
||||
*/
|
||||
public byte getUsernameLength() {
|
||||
return field_3_username_length ;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param byte representing the length of the username field
|
||||
*/
|
||||
public void setUsernameLength(byte length) {
|
||||
this.field_3_username_length = length;
|
||||
public short getUsernameLength() {
|
||||
return (short) field_3_username_value.length();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns username of the user that created the file
|
||||
*/
|
||||
public String getUsername() {
|
||||
return this.field_5_username;
|
||||
return field_3_username_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param username of the user that created the file
|
||||
*/
|
||||
public void setUsername(String username) {
|
||||
this.field_5_username = username;
|
||||
this.field_3_username_length = (byte)username.length();
|
||||
field_3_username_value = username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return short value of a "bonus field" in Excel that was not doc'd
|
||||
*/
|
||||
public short getUnknown() {
|
||||
return field_4_unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unknown field value to set (bonus field that is not doc'd)
|
||||
*/
|
||||
public void setUnknown(short unk) {
|
||||
field_4_unknown = unk;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
@ -183,10 +149,6 @@ public class FileSharingRecord extends Record {
|
||||
.append(getReadOnly() == 1 ? "true" : "false").append("\n");
|
||||
buffer.append(" .password = ")
|
||||
.append(Integer.toHexString(getPassword())).append("\n");
|
||||
buffer.append(" .userlen = ")
|
||||
.append(Integer.toHexString(getUsernameLength())).append("\n");
|
||||
buffer.append(" .unknown = ")
|
||||
.append(Integer.toHexString(getUnknown())).append("\n");
|
||||
buffer.append(" .username = ")
|
||||
.append(getUsername()).append("\n");
|
||||
buffer.append("[/FILESHARING]\n");
|
||||
@ -194,18 +156,25 @@ public class FileSharingRecord extends Record {
|
||||
}
|
||||
|
||||
public int serialize(int offset, byte [] data) {
|
||||
// TODO - junit
|
||||
LittleEndian.putShort(data, 0 + offset, sid);
|
||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize()-4));
|
||||
LittleEndian.putShort(data, 4 + offset, getReadOnly());
|
||||
LittleEndian.putShort(data, 6 + offset, getPassword());
|
||||
data[ 8 + offset ] = getUsernameLength();
|
||||
LittleEndian.putShort(data, 9 + offset, getUnknown());
|
||||
StringUtil.putCompressedUnicode( getUsername(), data, 11 + offset );
|
||||
LittleEndian.putShort(data, 8 + offset, getUsernameLength());
|
||||
if(getUsernameLength() > 0) {
|
||||
LittleEndian.putByte(data, 10 + offset, field_3_username_unicode_options);
|
||||
StringUtil.putCompressedUnicode( getUsername(), data, 11 + offset );
|
||||
}
|
||||
return getRecordSize();
|
||||
}
|
||||
|
||||
public int getRecordSize() {
|
||||
return 11+getUsernameLength();
|
||||
short nameLen = getUsernameLength();
|
||||
if (nameLen < 1) {
|
||||
return 10;
|
||||
}
|
||||
return 11+nameLen;
|
||||
}
|
||||
|
||||
public short getSid() {
|
||||
@ -219,10 +188,7 @@ public class FileSharingRecord extends Record {
|
||||
FileSharingRecord clone = new FileSharingRecord();
|
||||
clone.setReadOnly(field_1_readonly);
|
||||
clone.setPassword(field_2_password);
|
||||
clone.setUsernameLength(field_3_username_length);
|
||||
clone.setUnknown(field_4_unknown);
|
||||
clone.setUsername(field_5_username);
|
||||
clone.setUsername(field_3_username_value);
|
||||
return clone;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ import org.apache.poi.util.LittleEndian;
|
||||
* @version 2.0-pre
|
||||
*/
|
||||
|
||||
public class FormulaRecord
|
||||
public final class FormulaRecord
|
||||
extends Record
|
||||
implements CellValueRecordInterface, Comparable
|
||||
{
|
||||
@ -108,6 +108,11 @@ public class FormulaRecord
|
||||
} catch (java.lang.UnsupportedOperationException uoe) {
|
||||
throw new RecordFormatException(uoe);
|
||||
}
|
||||
if (in.remaining() == 10) {
|
||||
// TODO - this seems to occur when IntersectionPtg is present
|
||||
// 10 extra bytes are just 0x01 and 0x00
|
||||
// This causes POI stderr: "WARN. Unread 10 bytes of record 0x6"
|
||||
}
|
||||
}
|
||||
|
||||
//public void setRow(short row)
|
||||
|
@ -30,7 +30,6 @@ import org.apache.poi.hssf.record.RecordInputStream;
|
||||
* @author avik
|
||||
* @author Jason Height (jheight at chariot dot net dot au)
|
||||
*/
|
||||
|
||||
public abstract class Ptg
|
||||
{
|
||||
|
||||
@ -88,6 +87,10 @@ public abstract class Ptg
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Reads <tt>size</tt> bytes of the input stream, to create an array of <tt>Ptg</tt>s.
|
||||
* Extra data (beyond <tt>size</tt>) may be read if and <tt>ArrayPtg</tt>s are present.
|
||||
*/
|
||||
public static Stack createParsedExpressionTokens(short size, RecordInputStream in )
|
||||
{
|
||||
Stack stack = new Stack();
|
||||
@ -97,18 +100,21 @@ public abstract class Ptg
|
||||
{
|
||||
Ptg ptg = Ptg.createPtg( in );
|
||||
if (ptg instanceof ArrayPtg) {
|
||||
if (arrayPtgs == null)
|
||||
arrayPtgs = new ArrayList(5);
|
||||
arrayPtgs.add(ptg);
|
||||
pos += 8;
|
||||
if (arrayPtgs == null)
|
||||
arrayPtgs = new ArrayList(5);
|
||||
arrayPtgs.add(ptg);
|
||||
pos += 8;
|
||||
} else pos += ptg.getSize();
|
||||
stack.push( ptg );
|
||||
}
|
||||
if(pos != size) {
|
||||
throw new RuntimeException("Ptg array size mismatch");
|
||||
}
|
||||
if (arrayPtgs != null) {
|
||||
for (int i=0;i<arrayPtgs.size();i++) {
|
||||
ArrayPtg p = (ArrayPtg)arrayPtgs.get(i);
|
||||
p.readTokenValues(in);
|
||||
}
|
||||
for (int i=0;i<arrayPtgs.size();i++) {
|
||||
ArrayPtg p = (ArrayPtg)arrayPtgs.get(i);
|
||||
p.readTokenValues(in);
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
@ -137,8 +143,8 @@ public abstract class Ptg
|
||||
break;
|
||||
|
||||
case DividePtg.sid : // 0x06
|
||||
retval = new DividePtg(in);
|
||||
break;
|
||||
retval = new DividePtg(in);
|
||||
break;
|
||||
|
||||
case PowerPtg.sid : // 0x07
|
||||
retval = new PowerPtg(in);
|
||||
@ -146,62 +152,62 @@ public abstract class Ptg
|
||||
|
||||
case ConcatPtg.sid : // 0x08
|
||||
retval = new ConcatPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case LessThanPtg.sid: // 0x09
|
||||
retval = new LessThanPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case LessEqualPtg.sid : // 0x0a
|
||||
retval = new LessEqualPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case EqualPtg.sid : // 0x0b
|
||||
retval = new EqualPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case GreaterEqualPtg.sid : // 0x0c
|
||||
retval = new GreaterEqualPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case GreaterThanPtg.sid : // 0x0d
|
||||
retval = new GreaterThanPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case NotEqualPtg.sid : // 0x0e
|
||||
retval = new NotEqualPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case IntersectionPtg.sid : // 0x0f
|
||||
retval = new IntersectionPtg(in);
|
||||
break;
|
||||
break;
|
||||
case UnionPtg.sid : // 0x10
|
||||
retval = new UnionPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case RangePtg.sid : // 0x11
|
||||
retval = new RangePtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case UnaryPlusPtg.sid : // 0x12
|
||||
retval = new UnaryPlusPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case UnaryMinusPtg.sid : // 0x13
|
||||
retval = new UnaryMinusPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case PercentPtg.sid : // 0x14
|
||||
retval = new PercentPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case ParenthesisPtg.sid : // 0x15
|
||||
retval = new ParenthesisPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case MissingArgPtg.sid : // 0x16
|
||||
retval = new MissingArgPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case StringPtg.sid : // 0x17
|
||||
retval = new StringPtg(in);
|
||||
@ -210,11 +216,11 @@ public abstract class Ptg
|
||||
case AttrPtg.sid : // 0x19
|
||||
case 0x1a :
|
||||
retval = new AttrPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case ErrPtg.sid : // 0x1c
|
||||
retval = new ErrPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case BoolPtg.sid : // 0x1d
|
||||
retval = new BoolPtg(in);
|
||||
@ -222,21 +228,21 @@ public abstract class Ptg
|
||||
|
||||
case IntPtg.sid : // 0x1e
|
||||
retval = new IntPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case NumberPtg.sid : // 0x1f
|
||||
retval = new NumberPtg(in);
|
||||
break;
|
||||
retval = new NumberPtg(in);
|
||||
break;
|
||||
|
||||
case ArrayPtg.sid : // 0x20
|
||||
retval = new ArrayPtg(in);
|
||||
break;
|
||||
retval = new ArrayPtg(in);
|
||||
break;
|
||||
case ArrayPtgV.sid : // 0x40
|
||||
retval = new ArrayPtgV(in);
|
||||
break;
|
||||
retval = new ArrayPtgV(in);
|
||||
break;
|
||||
case ArrayPtgA.sid : // 0x60
|
||||
retval = new ArrayPtgA(in);
|
||||
break;
|
||||
retval = new ArrayPtgA(in);
|
||||
break;
|
||||
|
||||
case FuncPtg.sid : // 0x21
|
||||
case FuncPtg.sid + 0x20 : // 0x41
|
||||
@ -248,11 +254,11 @@ public abstract class Ptg
|
||||
case FuncVarPtg.sid + 0x20 : // 0x42
|
||||
case FuncVarPtg.sid + 0x40 : // 0x62
|
||||
retval = new FuncVarPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case ReferencePtg.sid : // 0x24
|
||||
retval = new ReferencePtg(in);
|
||||
break;
|
||||
break;
|
||||
case RefAPtg.sid : // 0x64
|
||||
retval = new RefAPtg(in);
|
||||
break;
|
||||
@ -271,7 +277,7 @@ public abstract class Ptg
|
||||
|
||||
case AreaPtg.sid : // 0x25
|
||||
retval = new AreaPtg(in);
|
||||
break;
|
||||
break;
|
||||
case AreaVPtg.sid: // 0x45
|
||||
retval = new AreaVPtg(in);
|
||||
break;
|
||||
@ -298,7 +304,7 @@ public abstract class Ptg
|
||||
case MemErrPtg.sid + 0x20 : // 0x47
|
||||
case MemErrPtg.sid + 0x40 : // 0x67
|
||||
retval = new MemErrPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case MemFuncPtg.sid : // 0x29
|
||||
retval = new MemFuncPtg(in);
|
||||
@ -308,13 +314,13 @@ public abstract class Ptg
|
||||
case RefErrorPtg.sid + 0x20 : // 0x4a
|
||||
case RefErrorPtg.sid + 0x40 : // 0x6a
|
||||
retval = new RefErrorPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case AreaErrPtg.sid : // 0x2b
|
||||
case AreaErrPtg.sid + 0x20 : // 0x4b
|
||||
case AreaErrPtg.sid + 0x40 : // 0x6b
|
||||
retval = new AreaErrPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case NamePtg.sid : // 0x23
|
||||
case NamePtg.sid + 0x20 : // 0x43
|
||||
@ -326,25 +332,25 @@ public abstract class Ptg
|
||||
case NameXPtg.sid + 0x20 : // 0x45
|
||||
case NameXPtg.sid + 0x40 : // 0x79
|
||||
retval = new NameXPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case Area3DPtg.sid : // 0x3b
|
||||
case Area3DPtg.sid + 0x20 : // 0x5b
|
||||
case Area3DPtg.sid + 0x40 : // 0x7b
|
||||
retval = new Area3DPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case Ref3DPtg.sid : // 0x3a
|
||||
case Ref3DPtg.sid + 0x20: // 0x5a
|
||||
case Ref3DPtg.sid + 0x40: // 0x7a
|
||||
retval = new Ref3DPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case DeletedRef3DPtg.sid: // 0x3c
|
||||
case DeletedRef3DPtg.sid + 0x20: // 0x5c
|
||||
case DeletedRef3DPtg.sid + 0x40: // 0x7c
|
||||
retval = new DeletedRef3DPtg(in);
|
||||
break;
|
||||
break;
|
||||
|
||||
case DeletedArea3DPtg.sid : // 0x3d
|
||||
case DeletedArea3DPtg.sid + 0x20 : // 0x5d
|
||||
@ -353,8 +359,8 @@ public abstract class Ptg
|
||||
break;
|
||||
|
||||
case 0x00:
|
||||
retval = new UnknownPtg();
|
||||
break;
|
||||
retval = new UnknownPtg();
|
||||
break;
|
||||
|
||||
default :
|
||||
//retval = new UnknownPtg();
|
||||
@ -375,31 +381,31 @@ public abstract class Ptg
|
||||
}
|
||||
|
||||
public static int serializePtgStack(Stack expression, byte[] array, int offset) {
|
||||
int pos = 0;
|
||||
int size = 0;
|
||||
if (expression != null)
|
||||
size = expression.size();
|
||||
int pos = 0;
|
||||
int size = 0;
|
||||
if (expression != null)
|
||||
size = expression.size();
|
||||
|
||||
List arrayPtgs = null;
|
||||
List arrayPtgs = null;
|
||||
|
||||
for (int k = 0; k < size; k++) {
|
||||
Ptg ptg = ( Ptg ) expression.get(k);
|
||||
for (int k = 0; k < size; k++) {
|
||||
Ptg ptg = ( Ptg ) expression.get(k);
|
||||
|
||||
ptg.writeBytes(array, pos + offset);
|
||||
if (ptg instanceof ArrayPtg) {
|
||||
if (arrayPtgs == null)
|
||||
arrayPtgs = new ArrayList(5);
|
||||
arrayPtgs.add(ptg);
|
||||
pos += 8;
|
||||
} else pos += ptg.getSize();
|
||||
}
|
||||
if (arrayPtgs != null) {
|
||||
for (int i=0;i<arrayPtgs.size();i++) {
|
||||
ArrayPtg p = (ArrayPtg)arrayPtgs.get(i);
|
||||
pos += p.writeTokenValueBytes(array, pos + offset);
|
||||
}
|
||||
}
|
||||
return pos;
|
||||
ptg.writeBytes(array, pos + offset);
|
||||
if (ptg instanceof ArrayPtg) {
|
||||
if (arrayPtgs == null)
|
||||
arrayPtgs = new ArrayList(5);
|
||||
arrayPtgs.add(ptg);
|
||||
pos += 8;
|
||||
} else pos += ptg.getSize();
|
||||
}
|
||||
if (arrayPtgs != null) {
|
||||
for (int i=0;i<arrayPtgs.size();i++) {
|
||||
ArrayPtg p = (ArrayPtg)arrayPtgs.get(i);
|
||||
pos += p.writeTokenValueBytes(array, pos + offset);
|
||||
}
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
public abstract int getSize();
|
||||
|
Loading…
Reference in New Issue
Block a user