@Override
    protected void deserializeItemsFromByteArray(byte[] byteArray, AtomicInteger currentIndex,
                                                 int lengthOfItems) throws TikaException {
        AtomicInteger index = new AtomicInteger(currentIndex.get());

        try {
            this.dataElementExGuid = BasicObject.parse(byteArray, index, ExGuid.class);
            this.serialNumber = BasicObject.parse(byteArray, index, SerialNumber.class);
            this.dataElementType = DataElementType.fromIntVal(
                    (int) BasicObject.parse(byteArray, index, Compact64bitInt.class)
                            .getDecodedValue());
        } catch (Exception e) {
            throw new DataElementParseErrorException(index.get(), e);
        }

        if (index.get() - currentIndex.get() != lengthOfItems) {
            throw new DataElementParseErrorException(currentIndex.get(),
                    "Failed to check the data element header length, whose value does not cover the " +
                            "dataElementExGUID, SerialNumber and DataElementType", null);
        }

        if (DATA_ELEMENT_DATA_TYPE_MAPPING.containsKey(this.dataElementType)) {
            try {
                this.data = (DataElementData) DATA_ELEMENT_DATA_TYPE_MAPPING.get(this.dataElementType)
                        .getDeclaredConstructor().newInstance();
            } catch (InstantiationException | IllegalAccessException | NoSuchMethodException |
                     InvocationTargetException e) {
                throw new TikaException("Could not instantiate a " + dataElementType, e);
            }

            try {
                index.addAndGet(
                        this.data.deserializeDataElementDataFromByteArray(byteArray, index.get()));
            } catch (Exception e) {
                throw new DataElementParseErrorException(index.get(), e);
            }
        } else {
            throw new DataElementParseErrorException(index.get(),
                    "Failed to create specific data element instance with the type " +
                            this.dataElementType, null);
        }

        currentIndex.set(index.get());
    }
Used to de-serialize the element.

@param byteArray     A
                     Byte array
@param currentIndex  Start
                     position
@param lengthOfItems The
                     length of
                     the items
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/onenote/fsshttpb/streamobj/DataElement.java