EscherBlipRecordpublic class EscherBlipRecord extends EscherRecord
Fields Summary |
---|
public static final short | RECORD_ID_START | public static final short | RECORD_ID_END | public static final String | RECORD_DESCRIPTION | private static final int | HEADER_SIZE | protected byte[] | field_pictureData |
Constructors Summary |
---|
public EscherBlipRecord()
|
Methods Summary |
---|
public int | fillFields(byte[] data, int offset, org.apache.poi.ddf.EscherRecordFactory recordFactory)This method deserializes the record from a byte array.
int bytesAfterHeader = readHeader( data, offset );
int pos = offset + HEADER_SIZE;
field_pictureData = new byte[bytesAfterHeader];
System.arraycopy(data, pos, field_pictureData, 0, bytesAfterHeader);
return bytesAfterHeader + 8;
| public java.lang.String | getRecordName()The short name for this record
return "Blip";
| public int | getRecordSize()Returns the number of bytes that are required to serialize this record.
return field_pictureData.length + 4;
| public int | serialize(int offset, byte[] data, org.apache.poi.ddf.EscherSerializationListener listener)Serializes the record to an existing byte array.
listener.beforeRecordSerialize(offset, getRecordId(), this);
LittleEndian.putShort( data, offset, getOptions() );
LittleEndian.putShort( data, offset + 2, getRecordId() );
System.arraycopy( field_pictureData, 0, data, offset + 4, field_pictureData.length );
listener.afterRecordSerialize(offset + 4 + field_pictureData.length, getRecordId(), field_pictureData.length + 4, this);
return field_pictureData.length + 4;
| public java.lang.String | toString()
String nl = System.getProperty( "line.separator" );
String extraData;
ByteArrayOutputStream b = new ByteArrayOutputStream();
try
{
HexDump.dump( this.field_pictureData, 0, b, 0 );
extraData = b.toString();
}
catch ( Exception e )
{
extraData = e.toString();
}
return getClass().getName() + ":" + nl +
" RecordId: 0x" + HexDump.toHex( getRecordId() ) + nl +
" Options: 0x" + HexDump.toHex( getOptions() ) + nl +
" Extra Data:" + nl + extraData;
|
|