FileDocCategorySizeDatePackage
ContinueRecord.javaAPI DocApache Poi 3.0.14211Mon Jan 01 12:39:40 GMT 2007org.apache.poi.hssf.record

ContinueRecord

public class ContinueRecord extends Record
Title: Continue Record - Helper class used primarily for SST Records

Description: handles overflow for prior record in the input stream; content is tailored to that prior record

author
Marc Johnson (mjohnson at apache dot org)
author
Andrew C. Oliver (acoliver at apache dot org)
author
Csaba Nagy (ncsaba at yahoo dot com)
version
2.0-pre

Fields Summary
public static final short
sid
private byte[]
field_1_data
Constructors Summary
public ContinueRecord()
default constructor


           

     
    
    
public ContinueRecord(RecordInputStream in)
Main constructor -- kinda dummy because we don't validate or fill fields

param
id record id
param
size record size
param
data raw data

        super(in);
    
Methods Summary
public java.lang.Objectclone()
Clone this record.

      ContinueRecord clone = new ContinueRecord();
      clone.setData(field_1_data);
      return clone;
    
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)
Fill the fields. Only thing is, this record has no fields --

param
ignored_parm1 Ignored
param
ignored_parm2 Ignored
param
ignored_parm3 Ignored

      field_1_data = in.readRemainder();
    
public byte[]getData()
get the data for continuation

return
byte array containing all of the continued data

        return field_1_data;
    
public shortgetSid()

        return sid;
    
public byte[]serialize()
USE ONLY within "processContinue"

        byte[] retval = new byte[ field_1_data.length + 4 ];
        serialize(0, retval);
        return retval;
    
public intserialize(int offset, byte[] data)


        LittleEndian.putShort(data, offset, sid);
        LittleEndian.putShort(data, offset + 2, ( short ) field_1_data.length);
        System.arraycopy(field_1_data, 0, data, offset + 4, field_1_data.length);
        return field_1_data.length + 4;
        // throw new RecordFormatException(
        //    "You're not supposed to serialize Continue records like this directly");
    
public voidsetData(byte[] data)
set the data for continuation

param
data - a byte array containing all of the continued data

        field_1_data = data;
    
public java.lang.StringtoString()
Debugging toString

return
string representation

        StringBuffer buffer = new StringBuffer();

        buffer.append("[CONTINUE RECORD]\n");
        buffer.append("    .id        = ").append(Integer.toHexString(sid))
            .append("\n");
        buffer.append("[/CONTINUE RECORD]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)
Make sure we have a good id

param
id the alleged id

        if (id != ContinueRecord.sid)
        {
            throw new RecordFormatException("Not a Continue Record");
        }