Class StreamObject
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
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStreamObject(StreamObjectTypeHeaderStart streamObjectType) Initializes a new instance of the StreamObject class. -
Method Summary
Modifier and TypeMethodDescriptionintdeserializeFromByteArray(StreamObjectHeaderStart header, byte[] byteArray, int startIndex) Used to return the length of this element.protected abstract voiddeserializeItemsFromByteArray(byte[] byteArray, AtomicInteger currentIndex, int lengthOfItems) De-serialize items from byte array.static Set<StreamObjectTypeHeaderStart>Gets the StreamObjectTypeHeaderStartstatic <T extends StreamObject>
TgetCurrent(byte[] byteArray, AtomicInteger index, Class<T> clazz) Get current stream object.static Map<StreamObjectTypeHeaderStart,Class> Gets the StreamObjectTypeMappingstatic StreamObjectparseStreamObject(StreamObjectHeaderStart header, byte[] byteArray, AtomicInteger index) Parse stream object from byte array.protected abstract intserializeItemsToByteList(List<Byte> byteList) Serialize items to byte list.Serialize item to byte list.static <T extends StreamObject>
booleantryGetCurrent(byte[] byteArray, AtomicInteger index, AtomicReference<T> streamObject, Class<T> clazz) Try to get current object, true will returned if success.
-
Constructor Details
-
StreamObject
Initializes a new instance of the StreamObject class.- Parameters:
streamObjectType- The instance of StreamObjectTypeHeaderStart.
-
-
Method Details
-
getCompoundTypes
Gets the StreamObjectTypeHeaderStart -
getStreamObjectTypeMapping
Gets the StreamObjectTypeMapping -
getCurrent
public static <T extends StreamObject> T getCurrent(byte[] byteArray, AtomicInteger index, Class<T> clazz) throws 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:
TikaExceptionIOException
-
parseStreamObject
public static StreamObject parseStreamObject(StreamObjectHeaderStart header, byte[] byteArray, AtomicInteger index) throws IOException, 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:
IOExceptionTikaException
-
tryGetCurrent
public static <T extends StreamObject> boolean tryGetCurrent(byte[] byteArray, AtomicInteger index, AtomicReference<T> streamObject, Class<T> clazz) throws 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:
TikaExceptionIOException
-
serializeToByteList
Serialize item to byte list.- Specified by:
serializeToByteListin interfaceIFSSHTTPBSerializable- Returns:
- The byte list.
- Throws:
IOExceptionTikaException
-
deserializeFromByteArray
public int deserializeFromByteArray(StreamObjectHeaderStart header, byte[] byteArray, int startIndex) throws IOException, TikaException Used to return the length of this element.- Parameters:
header- Then instance of StreamObjectHeaderStart.byteArray- The byte liststartIndex- The position where to start.- Returns:
- The element length
- Throws:
IOExceptionTikaException
-
serializeItemsToByteList
protected abstract int serializeItemsToByteList(List<Byte> byteList) throws IOException, 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:
IOExceptionTikaException
-
deserializeItemsFromByteArray
protected abstract void deserializeItemsFromByteArray(byte[] byteArray, AtomicInteger currentIndex, int lengthOfItems) throws 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:
TikaExceptionIOException
-