Package org.apache.poi.ddf
Class EscherBSERecord
- java.lang.Object
-
- org.apache.poi.ddf.EscherRecord
-
- org.apache.poi.ddf.EscherBSERecord
-
- All Implemented Interfaces:
Duplicatable,GenericRecord
public final class EscherBSERecord extends EscherRecord
The BSE record is related closely to theEscherBlipRecordand stores extra information about the blip. A blip record is actually stored inside the BSE record even though the BSE record isn't actually a container record.- See Also:
EscherBlipRecord
-
-
Field Summary
Fields Modifier and Type Field Description static shortRECORD_ID
-
Constructor Summary
Constructors Constructor Description EscherBSERecord()EscherBSERecord(EscherBSERecord other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EscherBSERecordcopy()intfillFields(byte[] data, int offset, EscherRecordFactory recordFactory)The contract of this method is to deserialize an escher record including its children.EscherBlipRecordgetBlipRecord()bytegetBlipTypeMacOS()The expected blip type under MacOS (failure to match this blip type will result in Excel converting to this format).bytegetBlipTypeWin32()The expected blip type under windows (failure to match this blip type will result in Excel converting to this format).Map<String,Supplier<?>>getGenericProperties()EnumgetGenericRecordType()static intgetMaxRecordLength()bytegetName()The length in characters of the blip name.intgetOffset()File offset in the delay stream.PictureData.PictureTypegetPictureTypeMacOS()PictureData.PictureTypegetPictureTypeWin32()StringgetRecordName()Subclasses should return the short name for this escher record.intgetRecordSize()Subclasses should effeciently return the number of bytes required to serialize the record.intgetRef()The reference count of this blip.byte[]getRemainingData()Any remaining data in this record.intgetSize()Blip size in stream.shortgetTag()unusedbyte[]getUid()16 byte MD4 checksum.bytegetUnused2()bytegetUnused3()bytegetUsage()Defines the way this blip is used.intserialize(int offset, byte[] data, EscherSerializationListener listener)Serializes the record to an existing byte array.voidsetBlipRecord(EscherBlipRecord blipRecord)voidsetBlipTypeMacOS(byte blipTypeMacOS)Set the expected MacOS blip typevoidsetBlipTypeWin32(byte blipTypeWin32)Set the expected win32 blip typestatic voidsetMaxRecordLength(int length)voidsetName(byte name)The length in characters of the blip name.voidsetOffset(int offset)File offset in the delay stream.voidsetRef(int ref)The reference count of this blip.voidsetRemainingData(byte[] remainingData)Any remaining data in this record.voidsetSize(int size)Blip size in stream.voidsetTag(short tag)unusedvoidsetUid(byte[] uid)16 byte MD4 checksum.voidsetUnused2(byte unused2)voidsetUnused3(byte unused3)voidsetUsage(byte usage)Defines the way this blip is used.-
Methods inherited from class org.apache.poi.ddf.EscherRecord
display, fillFields, getChild, getChildRecords, getGenericChildren, getInstance, getOptions, getRecordId, getVersion, isContainerRecord, readHeader, readInstance, serialize, serialize, setChildRecords, setInstance, setOptions, setRecordId, setVersion, toString, toXml, toXml
-
-
-
-
Constructor Detail
-
EscherBSERecord
public EscherBSERecord()
-
EscherBSERecord
public EscherBSERecord(EscherBSERecord other)
-
-
Method Detail
-
setMaxRecordLength
public static void setMaxRecordLength(int length)
- Parameters:
length- the max record length allowed for EscherBSERecord
-
getMaxRecordLength
public static int getMaxRecordLength()
- Returns:
- the max record length allowed for EscherBSERecord
-
fillFields
public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory)Description copied from class:EscherRecordThe contract of this method is to deserialize an escher record including its children.- Specified by:
fillFieldsin classEscherRecord- Parameters:
data- The byte array containing the serialized escher records.offset- The offset into the byte array.recordFactory- A factory for creating new escher records.- Returns:
- The number of bytes written.
-
serialize
public int serialize(int offset, byte[] data, EscherSerializationListener listener)Description copied from class:EscherRecordSerializes the record to an existing byte array.- Specified by:
serializein classEscherRecord- Parameters:
offset- the offset within the byte arraydata- the data array to serialize tolistener- a listener for begin and end serialization events. This is useful because the serialization is hierarchical/recursive and sometimes you need to be able break into that.- Returns:
- the number of bytes written.
-
getRecordSize
public int getRecordSize()
Description copied from class:EscherRecordSubclasses should effeciently return the number of bytes required to serialize the record.- Specified by:
getRecordSizein classEscherRecord- Returns:
- number of bytes
-
getRecordName
public String getRecordName()
Description copied from class:EscherRecordSubclasses should return the short name for this escher record.- Specified by:
getRecordNamein classEscherRecord- Returns:
- the short name for this escher record
-
getBlipTypeWin32
public byte getBlipTypeWin32()
The expected blip type under windows (failure to match this blip type will result in Excel converting to this format).- Returns:
- win32 blip type
-
getPictureTypeWin32
public PictureData.PictureType getPictureTypeWin32()
-
setBlipTypeWin32
public void setBlipTypeWin32(byte blipTypeWin32)
Set the expected win32 blip type- Parameters:
blipTypeWin32- win32 blip type
-
getBlipTypeMacOS
public byte getBlipTypeMacOS()
The expected blip type under MacOS (failure to match this blip type will result in Excel converting to this format).- Returns:
- MacOS blip type
-
getPictureTypeMacOS
public PictureData.PictureType getPictureTypeMacOS()
-
setBlipTypeMacOS
public void setBlipTypeMacOS(byte blipTypeMacOS)
Set the expected MacOS blip type- Parameters:
blipTypeMacOS- MacOS blip type
-
getUid
public byte[] getUid()
16 byte MD4 checksum.- Returns:
- 16 byte MD4 checksum
-
setUid
public void setUid(byte[] uid)
16 byte MD4 checksum.- Parameters:
uid- 16 byte MD4 checksum
-
getTag
public short getTag()
unused- Returns:
- an unknown tag
-
setTag
public void setTag(short tag)
unused- Parameters:
tag- unknown tag
-
getSize
public int getSize()
Blip size in stream.- Returns:
- the blip size
-
setSize
public void setSize(int size)
Blip size in stream.- Parameters:
size- blip size
-
getRef
public int getRef()
The reference count of this blip.- Returns:
- the reference count
-
setRef
public void setRef(int ref)
The reference count of this blip.- Parameters:
ref- the reference count
-
getOffset
public int getOffset()
File offset in the delay stream.- Returns:
- the file offset
-
setOffset
public void setOffset(int offset)
File offset in the delay stream.- Parameters:
offset- the file offset
-
getUsage
public byte getUsage()
Defines the way this blip is used.- Returns:
- the blip usage
-
setUsage
public void setUsage(byte usage)
Defines the way this blip is used.- Parameters:
usage- the blip usae
-
getName
public byte getName()
The length in characters of the blip name.- Returns:
- the blip name length
-
setName
public void setName(byte name)
The length in characters of the blip name.- Parameters:
name- the blip name length
-
getUnused2
public byte getUnused2()
-
setUnused2
public void setUnused2(byte unused2)
-
getUnused3
public byte getUnused3()
-
setUnused3
public void setUnused3(byte unused3)
-
getBlipRecord
public EscherBlipRecord getBlipRecord()
-
setBlipRecord
public void setBlipRecord(EscherBlipRecord blipRecord)
-
getRemainingData
public byte[] getRemainingData()
Any remaining data in this record.- Returns:
- the remaining bytes
-
setRemainingData
public void setRemainingData(byte[] remainingData)
Any remaining data in this record.- Parameters:
remainingData- the remaining bytes
-
getGenericProperties
public Map<String,Supplier<?>> getGenericProperties()
- Specified by:
getGenericPropertiesin interfaceGenericRecord- Overrides:
getGenericPropertiesin classEscherRecord
-
getGenericRecordType
public Enum getGenericRecordType()
-
copy
public EscherBSERecord copy()
- Specified by:
copyin interfaceDuplicatable- Specified by:
copyin classEscherRecord- Returns:
- a deep copy of the implementing class / instance
-
-