@Override
    protected int doDeserializeFromByteArray(byte[] byteArray,
                                             int startIndex)
            throws IOException // return the length consumed
    {
        BitReader bitField = new BitReader(byteArray, startIndex);
        int type = bitField.readInt32(8);

        if (type == 0) {
            this.guid = GuidUtil.emptyGuid();
            this.type = 0;

            return 1;
        } else if (type == 128) {
            this.guid = bitField.readGuid();
            this.value = bitField.readUInt64(64);
            this.type = 128;
            return 25;
        } else {
            throw new IllegalArgumentException(
                    "Failed to parse SerialNumber object, Expect the type value is either 0 or 128, " +
                            "but the actual value is " + this.type);
        }
    }
This method is used to deserialize the SerialNumber basic object from the specified byte array and start index.

@param byteArray  Specify the byte array.
@param startIndex Specify the start index from the byte array.
@return Return the length in byte of the SerialNumber basic object.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/onenote/fsshttpb/streamobj/basic/SerialNumber.java