Package org.apache.poi.ddf
Class EscherBSERecord
java.lang.Object
org.apache.poi.ddf.EscherRecord
org.apache.poi.ddf.EscherBSERecord
- All Implemented Interfaces:
Cloneable
The BSE record is related closely to the
EscherBlipRecord
and 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final String
static final short
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
fillFields
(byte[] data, int offset, EscherRecordFactory recordFactory) The contract of this method is to deserialize an escher record including it's children.protected Object[][]
For the purpose of providing toString() and toXml() a subclass can either override those methods or provide a Object[][] array in the form{ { "Attribute Name (Header)", value, "optional attribute", value }, ... }
.static String
getBlipType
(byte b) Retrieve the string representation given a blip id.byte
The expected blip type under MacOS (failure to match this blip type will result in Excel converting to this format).byte
The expected blip type under windows (failure to match this blip type will result in Excel converting to this format).byte
getName()
The length in characters of the blip name.int
File offset in the delay stream.Subclasses should return the short name for this escher record.int
Subclasses should effeciently return the number of bytes required to serialize the record.int
getRef()
The reference count of this blip.byte[]
Any remaining data in this record.int
getSize()
Blip size in stream.short
getTag()
unusedbyte[]
getUid()
16 byte MD4 checksum.byte
byte
byte
getUsage()
Defines the way this blip is used.int
serialize
(int offset, byte[] data, EscherSerializationListener listener) Serializes the record to an existing byte array.void
setBlipRecord
(EscherBlipRecord blipRecord) void
setBlipTypeMacOS
(byte blipTypeMacOS) Set the expected MacOS blip typevoid
setBlipTypeWin32
(byte blipTypeWin32) Set the expected win32 blip typevoid
setName
(byte name) The length in characters of the blip name.void
setOffset
(int offset) File offset in the delay stream.void
setRef
(int ref) The reference count of this blip.void
setRemainingData
(byte[] remainingData) Any remaining data in this record.void
setSize
(int size) Blip size in stream.void
setTag
(short tag) unusedvoid
setUid
(byte[] uid) 16 byte MD4 checksum.void
setUnused2
(byte unused2) void
setUnused3
(byte unused3) void
setUsage
(byte usage) Defines the way this blip is used.Methods inherited from class org.apache.poi.ddf.EscherRecord
clone, display, fillFields, getChild, getChildRecords, getInstance, getOptions, getRecordId, getVersion, isContainerRecord, readHeader, readInstance, serialize, serialize, setChildRecords, setInstance, setOptions, setRecordId, setVersion, toString, toXml, toXml
-
Field Details
-
RECORD_ID
public static final short RECORD_ID- See Also:
-
RECORD_DESCRIPTION
- See Also:
-
BT_ERROR
public static final byte BT_ERROR- See Also:
-
BT_UNKNOWN
public static final byte BT_UNKNOWN- See Also:
-
BT_EMF
public static final byte BT_EMF- See Also:
-
BT_WMF
public static final byte BT_WMF- See Also:
-
BT_PICT
public static final byte BT_PICT- See Also:
-
BT_JPEG
public static final byte BT_JPEG- See Also:
-
BT_PNG
public static final byte BT_PNG- See Also:
-
BT_DIB
public static final byte BT_DIB- See Also:
-
-
Constructor Details
-
EscherBSERecord
public EscherBSERecord()
-
-
Method Details
-
fillFields
Description copied from class:EscherRecord
The contract of this method is to deserialize an escher record including it's children.- Specified by:
fillFields
in 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
Description copied from class:EscherRecord
Serializes the record to an existing byte array.- Specified by:
serialize
in 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:EscherRecord
Subclasses should effeciently return the number of bytes required to serialize the record.- Specified by:
getRecordSize
in classEscherRecord
- Returns:
- number of bytes
-
getRecordName
Description copied from class:EscherRecord
Subclasses should return the short name for this escher record.- Specified by:
getRecordName
in 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
-
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
-
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
-
setBlipRecord
-
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
-
getBlipType
Retrieve the string representation given a blip id.- Parameters:
b
- the blip type byte-encoded- Returns:
- the blip type as string
-
getAttributeMap
Description copied from class:EscherRecord
For the purpose of providing toString() and toXml() a subclass can either override those methods or provide a Object[][] array in the form{ { "Attribute Name (Header)", value, "optional attribute", value }, ... }
.Null values won't be printed.
The attributes record, version, instance, options must not be returned.
- Specified by:
getAttributeMap
in classEscherRecord
- Returns:
- the attribute map
-