Package loci.poi.ddf
Class EscherBlipWMFRecord
- java.lang.Object
-
- loci.poi.ddf.EscherRecord
-
- loci.poi.ddf.EscherBlipRecord
-
- loci.poi.ddf.EscherBlipWMFRecord
-
public class EscherBlipWMFRecord extends EscherBlipRecord
The blip record is used to hold details about large binary objects that occur in escher such as JPEG, GIF, PICT and WMF files. The contents of the stream is usually compressed. Inflate can be used to decompress the data.- Author:
- Glen Stampoultzis
- See Also:
Inflater
-
-
Field Summary
Fields Modifier and Type Field Description static String
RECORD_DESCRIPTION
-
Fields inherited from class loci.poi.ddf.EscherBlipRecord
field_pictureData, RECORD_ID_END, RECORD_ID_START
-
-
Constructor Summary
Constructors Constructor Description EscherBlipWMFRecord()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte[]
compress(byte[] data)
Compress the contents of the provided arraystatic byte[]
decompress(byte[] data, int pos, int length)
Decompresses a byte array.int
fillFields(byte[] data, int offset, EscherRecordFactory recordFactory)
This method deserializes the record from a byte array.int
getBoundaryHeight()
Retrieve the boundary height of the metafile drawing commandsint
getBoundaryLeft()
Retrieve the left boundary of the metafile drawing commandsint
getBoundaryTop()
Retrieve the top boundary of the metafile drawing commandsint
getBoundaryWidth()
Retrieve the boundary width of the metafile drawing commandsint
getCacheOfSavedSize()
Retrieve the cache of the saved sizeint
getCacheOfSize()
Retrieve the cache of the metafile sizebyte
getCompressionFlag()
Is the contents of the blip compressed?byte[]
getData()
The BLIP databyte
getFilter()
Filter should always be 0int
getHeight()
Retrieve the height of the metafile in EMU's (English Metric Units).String
getRecordName()
The short name for this recordint
getRecordSize()
Returns the number of bytes that are required to serialize this record.byte[]
getSecondaryUID()
Retrieve the secondary UIDint
getWidth()
Retrieve the width of the metafile in EMU's (English Metric Units).int
serialize(int offset, byte[] data, EscherSerializationListener listener)
This method serializes this escher record into a byte array.void
setBoundaryHeight(int field_6_boundaryHeight)
Set the boundary height of the metafile drawing commandsvoid
setBoundaryLeft(int field_4_boundaryLeft)
Set the left boundary of the metafile drawing commandsvoid
setBoundaryTop(int field_3_boundaryTop)
Set the top boundary of the metafile drawing commandsvoid
setBoundaryWidth(int field_5_boundaryWidth)
Set the boundary width of the metafile drawing commandsvoid
setCacheOfSavedSize(int field_9_cacheOfSavedSize)
Set the cache of the saved sizevoid
setCacheOfSize(int field_2_cacheOfSize)
Set the cache of the metafile sizevoid
setCompressionFlag(byte field_10_compressionFlag)
Set whether the contents of the blip is compressedvoid
setData(byte[] field_12_data)
The BLIP datavoid
setFilter(byte field_11_filter)
Filter should always be 0void
setHeight(int height)
Set the height of the metafile in EMU's (English Metric Units).void
setSecondaryUID(byte[] field_1_secondaryUID)
Set the secondary UIDvoid
setWidth(int width)
Set the width of the metafile in EMU's (English Metric Units).String
toString()
The string representation of this record.-
Methods inherited from class loci.poi.ddf.EscherBlipRecord
getPicturedata, setPictureData
-
Methods inherited from class loci.poi.ddf.EscherRecord
clone, display, fillFields, getChild, getChildRecords, getInstance, getOptions, getRecordId, isContainerRecord, readHeader, serialize, serialize, setChildRecords, setOptions, setRecordId
-
-
-
-
Field Detail
-
RECORD_DESCRIPTION
public static final String RECORD_DESCRIPTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
fillFields
public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory)
This method deserializes the record from a byte array.- Overrides:
fillFields
in classEscherBlipRecord
- Parameters:
data
- The byte array containing the escher record informationoffset
- The starting offset intodata
.recordFactory
- May be null since this is not a container record.- Returns:
- The number of bytes read from the byte array.
-
serialize
public int serialize(int offset, byte[] data, EscherSerializationListener listener)
This method serializes this escher record into a byte array.- Overrides:
serialize
in classEscherBlipRecord
- Parameters:
offset
- The offset intodata
to start writing the record data to.data
- The byte array to serialize to.listener
- A listener to retrieve start and end callbacks. Use aNullEscherSerailizationListener
to ignore these events.- Returns:
- The number of bytes written.
- See Also:
NullEscherSerializationListener
-
getRecordSize
public int getRecordSize()
Returns the number of bytes that are required to serialize this record.- Overrides:
getRecordSize
in classEscherBlipRecord
- Returns:
- Number of bytes
-
getRecordName
public String getRecordName()
The short name for this record- Overrides:
getRecordName
in classEscherBlipRecord
-
getSecondaryUID
public byte[] getSecondaryUID()
Retrieve the secondary UID
-
setSecondaryUID
public void setSecondaryUID(byte[] field_1_secondaryUID)
Set the secondary UID
-
getCacheOfSize
public int getCacheOfSize()
Retrieve the cache of the metafile size
-
setCacheOfSize
public void setCacheOfSize(int field_2_cacheOfSize)
Set the cache of the metafile size
-
getBoundaryTop
public int getBoundaryTop()
Retrieve the top boundary of the metafile drawing commands
-
setBoundaryTop
public void setBoundaryTop(int field_3_boundaryTop)
Set the top boundary of the metafile drawing commands
-
getBoundaryLeft
public int getBoundaryLeft()
Retrieve the left boundary of the metafile drawing commands
-
setBoundaryLeft
public void setBoundaryLeft(int field_4_boundaryLeft)
Set the left boundary of the metafile drawing commands
-
getBoundaryWidth
public int getBoundaryWidth()
Retrieve the boundary width of the metafile drawing commands
-
setBoundaryWidth
public void setBoundaryWidth(int field_5_boundaryWidth)
Set the boundary width of the metafile drawing commands
-
getBoundaryHeight
public int getBoundaryHeight()
Retrieve the boundary height of the metafile drawing commands
-
setBoundaryHeight
public void setBoundaryHeight(int field_6_boundaryHeight)
Set the boundary height of the metafile drawing commands
-
getWidth
public int getWidth()
Retrieve the width of the metafile in EMU's (English Metric Units).
-
setWidth
public void setWidth(int width)
Set the width of the metafile in EMU's (English Metric Units).
-
getHeight
public int getHeight()
Retrieve the height of the metafile in EMU's (English Metric Units).
-
setHeight
public void setHeight(int height)
Set the height of the metafile in EMU's (English Metric Units).
-
getCacheOfSavedSize
public int getCacheOfSavedSize()
Retrieve the cache of the saved size
-
setCacheOfSavedSize
public void setCacheOfSavedSize(int field_9_cacheOfSavedSize)
Set the cache of the saved size
-
getCompressionFlag
public byte getCompressionFlag()
Is the contents of the blip compressed?
-
setCompressionFlag
public void setCompressionFlag(byte field_10_compressionFlag)
Set whether the contents of the blip is compressed
-
getFilter
public byte getFilter()
Filter should always be 0
-
setFilter
public void setFilter(byte field_11_filter)
Filter should always be 0
-
getData
public byte[] getData()
The BLIP data
-
setData
public void setData(byte[] field_12_data)
The BLIP data
-
toString
public String toString()
The string representation of this record.- Overrides:
toString
in classEscherBlipRecord
- Returns:
- A string
-
compress
public static byte[] compress(byte[] data)
Compress the contents of the provided array- Parameters:
data
- An uncompressed byte array- See Also:
DeflaterOutputStream.write(int b)
-
decompress
public static byte[] decompress(byte[] data, int pos, int length)
Decompresses a byte array.- Parameters:
data
- The compressed byte arraypos
- The starting position into the byte arraylength
- The number of compressed bytes to decompress- Returns:
- An uncompressed byte array
- See Also:
InflaterInputStream.read()
-
-