## org.apache.poi.hpsf
Class ClassID

    java.lang.Object
      org.apache.poi.hpsf.ClassID

public class ClassID
extends java.lang.Object

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.

Since:
  2002-02-09
Version:
  $Id: ClassID.java,v 1.5.4.2 2004/02/22 11:54:45 glens Exp $
Author:
  Rainer Klute (klute@rainer-klute.de)

Field Summary
`protected byte[]` `bytes` The bytes making out the class ID in correct order, i.e.
`static int` `LENGTH` The number of bytes occupied by this object in the byte stream.

Constructor Summary
`ClassID()` Creates a `ClassID` and initializes its value with 0x00 bytes.
`ClassID(byte[] src, int offset)` Creates a `ClassID` and reads its value from a byte array.

Method Summary
`boolean` `equals(java.lang.Object o)` Checks whether this `ClassID` is equal to another object.
`byte[]` `getBytes()` Gets the bytes making out the class ID.
`int` `length()`
`byte[]` `read(byte[] src, int offset)` Reads the class ID's value from a byte array by turning little-endian into big-endian.
`java.lang.String` `toString()` Returns a human readable representation of the Class ID in standard format `"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"`
`void` `write(byte[] dst, int offset)` Writes the class ID to a byte array in the little-endian.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### bytes

    protected byte[] bytes

  The bytes making out the class ID in correct order, i.e. big-endian.

### LENGTH

    public static final int LENGTH

  The number of bytes occupied by this object in the byte stream.

  See Also:
    Constant Field Values

Constructor Detail

### ClassID

    public ClassID(byte[] src,
                   int offset)

  Creates a `ClassID` and 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 a `ClassID` and initializes its value with 0x00 bytes.

Method Detail

### 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.

### 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 from
    `offset` - The offset within the src byte array
  Returns:
    A byte array containing the class ID.

### write

    public void write(byte[] dst,
                      int offset)
               throws java.lang.ArrayStoreException

  Writes the class ID to a byte array in the little-endian.

  Parameters:
    `dst` - The byte array to write to.
    `offset` - The offset within the dst byte array.
  Throws:
    `java.lang.ArrayStoreException` - if there is not enough room for the class ID 16 bytes in the byte array after the offset position.

### equals

    public boolean equals(java.lang.Object o)

  Checks whether this `ClassID` is equal to another object.

  Parameters:
    `o` - the object to compare this `PropertySet` with
  Returns:
    `true` if the objects are equal, else `false`.

### toString

    public java.lang.String toString()

  Returns a human readable representation of the Class ID in standard format `"{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"`

  Returns:
    String representation of the Class ID represented by this object.

Copyright © 2003 Apache Software Foundation.