Package org.apache.poi.hpsf
Class ClassID
java.lang.Object
org.apache.poi.hpsf.ClassID
Represents a class ID (16 bytes). Unlike other little-endian
type the
ClassID is not just 16 bytes stored in the wrong
order. Instead, it is a double word (4 bytes) followed by two
words (2 bytes each) followed by 8 bytes.The ClassID (or CLSID) is a UUID - see RFC 4122
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClassIDDeprecated.static final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final intThe number of bytes occupied by this object in the byte stream.static final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefinedstatic final ClassIDDeprecated.use enumClassIDPredefined -
Constructor Summary
ConstructorsConstructorDescriptionClassID()Creates aClassIDand initializes its value with 0x00 bytes.ClassID(byte[] src, int offset) Creates aClassIDand reads its value from a byte array.Creates aClassIDfrom a human-readable representation of the Class ID in standard format"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}". -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether thisClassIDis equal to another object.booleanChecks whether thisClassIDis equal to another ClassID with inverted endianess, because there are apparently not only version 1 GUIDs (aka "network" with big-endian encoding), but also version 2 GUIDs (aka "native" with little-endian encoding) out there.byte[]getBytes()Gets the bytes making out the class ID.inthashCode()intlength()byte[]read(byte[] src, int offset) Reads the class ID's value from a byte array by turning little-endian into big-endian.voidsetBytes(byte[] bytes) Sets the bytes making out the class ID.toString()Returns a human-readable representation of the Class ID in standard format"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}".voidwrite(byte[] dst, int offset) Writes the class ID to a byte array in the little-endian format.
-
Field Details
-
OLE10_PACKAGE
Deprecated.use enumClassIDPredefined -
PPT_SHOW
Deprecated.use enumClassIDPredefined -
XLS_WORKBOOK
Deprecated.use enumClassIDPredefined -
TXT_ONLY
Deprecated.use enumClassIDPredefined -
EXCEL_V3
Deprecated.use enumClassIDPredefined -
EXCEL_V3_CHART
Deprecated.use enumClassIDPredefined -
EXCEL_V3_MACRO
Deprecated.use enumClassIDPredefined -
EXCEL95
Deprecated.use enumClassIDPredefined -
EXCEL95_CHART
Deprecated.use enumClassIDPredefined -
EXCEL97
Deprecated.use enumClassIDPredefined -
EXCEL97_CHART
Deprecated.use enumClassIDPredefined -
EXCEL2003
Deprecated.use enumClassIDPredefined -
EXCEL2007
Deprecated.use enumClassIDPredefined -
EXCEL2007_MACRO
Deprecated.use enumClassIDPredefined -
EXCEL2007_XLSB
Deprecated.use enumClassIDPredefined -
EXCEL2010
Deprecated.use enumClassIDPredefined -
EXCEL2010_CHART
Deprecated.use enumClassIDPredefined -
EXCEL2010_ODS
Deprecated.use enumClassIDPredefined -
WORD95
Deprecated.use enumClassIDPredefined -
WORD97
Deprecated.use enumClassIDPredefined -
WORD2007
Deprecated.use enumClassIDPredefined -
WORD2007_MACRO
Deprecated.use enumClassIDPredefined -
POWERPOINT97
Deprecated.use enumClassIDPredefined -
POWERPOINT95
Deprecated.use enumClassIDPredefined -
POWERPOINT2007
Deprecated.use enumClassIDPredefined -
POWERPOINT2007_MACRO
Deprecated.use enumClassIDPredefined -
EQUATION30
Deprecated.use enumClassIDPredefined -
LENGTH
public static final int LENGTHThe number of bytes occupied by this object in the byte stream.- See Also:
-
-
Constructor Details
-
ClassID
public ClassID(byte[] src, int offset) Creates aClassIDand reads its value from a byte array.- Parameters:
src- The byte array to read from.offset- The offset of the first byte to read.
-
ClassID
public ClassID()Creates aClassIDand initializes its value with 0x00 bytes. -
ClassID
Creates aClassIDfrom a human-readable representation of the Class ID in standard format"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}".- Parameters:
externalForm- representation of the Class ID represented by this object.
-
-
Method Details
-
length
public int length()- Returns:
- The number of bytes occupied by this object in the byte stream.
-
getBytes
public byte[] getBytes()Gets the bytes making out the class ID. They are returned in correct order, i.e. big-endian.- Returns:
- the bytes making out the class ID.
-
setBytes
public void setBytes(byte[] bytes) Sets the bytes making out the class ID.- Parameters:
bytes- The bytes making out the class ID in big-endian format. They are copied without their order being changed.
-
read
public byte[] read(byte[] src, int offset) Reads the class ID's value from a byte array by turning little-endian into big-endian.- Parameters:
src- The byte array to read fromoffset- The offset within thesrcbyte array- Returns:
- A byte array containing the class ID.
-
write
Writes the class ID to a byte array in the little-endian format.- Parameters:
dst- The byte array to write to.offset- The offset within thedstbyte array.- Throws:
ArrayStoreException- if there is not enough room for the class ID 16 bytes in the byte array after theoffsetposition.
-
equals
Checks whether thisClassIDis equal to another object. -
equalsInverted
Checks whether thisClassIDis equal to another ClassID with inverted endianess, because there are apparently not only version 1 GUIDs (aka "network" with big-endian encoding), but also version 2 GUIDs (aka "native" with little-endian encoding) out there.- Parameters:
o- the object to compare thisClassIDwith- Returns:
trueif the objects are equal, elsefalse.
-
hashCode
public int hashCode() -
toString
Returns a human-readable representation of the Class ID in standard format"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}".
-
ClassIDPredefined