java.lang.Object
org.apache.tika.parser.microsoft.onenote.fsshttpb.streamobj.StreamObject
All Implemented Interfaces:
IFSSHTTPBSerializable
Direct Known Subclasses:
CellManifestCurrentRevision, DataElement, DataElementHash, DataElementPackage, DataHashObject, DataSizeObject, NodeObject, ObjectGroupData, ObjectGroupDeclarations, ObjectGroupMetadata, ObjectGroupMetadataDeclarations, ObjectGroupObjectBLOBDataDeclaration, ObjectGroupObjectData, ObjectGroupObjectDataBLOBReference, ObjectGroupObjectDeclare, RevisionManifest, RevisionManifestObjectGroupReferences, RevisionManifestRootDeclare, SignatureObject, StorageIndexCellMapping, StorageIndexManifestMapping, StorageIndexRevisionMapping, StorageManifestRootDeclare, StorageManifestSchemaGUID

public abstract class StreamObject extends Object implements IFSSHTTPBSerializable
  • Constructor Details

    • StreamObject

      protected StreamObject(StreamObjectTypeHeaderStart streamObjectType)
      Initializes a new instance of the StreamObject class.
      Parameters:
      streamObjectType - The instance of StreamObjectTypeHeaderStart.
  • Method Details

    • getCompoundTypes

      public static Set<StreamObjectTypeHeaderStart> getCompoundTypes()
      Gets the StreamObjectTypeHeaderStart
    • getStreamObjectTypeMapping

      public static Map<StreamObjectTypeHeaderStart,Class> getStreamObjectTypeMapping()
      Gets the StreamObjectTypeMapping
    • getCurrent

      public static <T extends StreamObject> T getCurrent(byte[] byteArray, AtomicInteger index, Class<T> clazz) throws org.apache.tika.exception.TikaException, IOException
      Get current stream object.
      Parameters:
      byteArray - The byte array which contains message.
      index - The position where to start.
      Returns:
      The current object instance.
      Throws:
      org.apache.tika.exception.TikaException
      IOException
    • parseStreamObject

      public static StreamObject parseStreamObject(StreamObjectHeaderStart header, byte[] byteArray, AtomicInteger index) throws IOException, org.apache.tika.exception.TikaException
      Parse stream object from byte array.
      Parameters:
      header - The instance of StreamObjectHeaderStart.
      byteArray - The byte array.
      index - The position where to start.
      Returns:
      The instance of StreamObject.
      Throws:
      IOException
      org.apache.tika.exception.TikaException
    • tryGetCurrent

      public static <T extends StreamObject> boolean tryGetCurrent(byte[] byteArray, AtomicInteger index, AtomicReference<T> streamObject, Class<T> clazz) throws org.apache.tika.exception.TikaException, IOException
      Try to get current object, true will returned if success.
      Parameters:
      byteArray - The byte array.
      index - The position where to start.
      streamObject - The instance that want to get.
      Returns:
      The result of whether get success.
      Throws:
      org.apache.tika.exception.TikaException
      IOException
    • serializeToByteList

      public List<Byte> serializeToByteList() throws IOException, org.apache.tika.exception.TikaException
      Serialize item to byte list.
      Specified by:
      serializeToByteList in interface IFSSHTTPBSerializable
      Returns:
      The byte list.
      Throws:
      IOException
      org.apache.tika.exception.TikaException
    • deserializeFromByteArray

      public int deserializeFromByteArray(StreamObjectHeaderStart header, byte[] byteArray, int startIndex) throws IOException, org.apache.tika.exception.TikaException
      Used to return the length of this element.
      Parameters:
      header - Then instance of StreamObjectHeaderStart.
      byteArray - The byte list
      startIndex - The position where to start.
      Returns:
      The element length
      Throws:
      IOException
      org.apache.tika.exception.TikaException
    • serializeItemsToByteList

      protected abstract int serializeItemsToByteList(List<Byte> byteList) throws IOException, org.apache.tika.exception.TikaException
      Serialize items to byte list.
      Parameters:
      byteList - The byte list need to serialized.
      Returns:
      The length in bytes for additional data if the current stream object has, otherwise return 0.
      Throws:
      IOException
      org.apache.tika.exception.TikaException
    • deserializeItemsFromByteArray

      protected abstract void deserializeItemsFromByteArray(byte[] byteArray, AtomicInteger currentIndex, int lengthOfItems) throws org.apache.tika.exception.TikaException, IOException
      De-serialize items from byte array.
      Parameters:
      byteArray - The byte array which contains response message.
      currentIndex - The index special where to start.
      lengthOfItems - The length of items.
      Throws:
      org.apache.tika.exception.TikaException
      IOException