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
public abstract class StreamObject extends Object implements IFSSHTTPBSerializable
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StreamObject(StreamObjectTypeHeaderStart streamObjectType)
Initializes a new instance of the StreamObject class.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
deserializeFromByteArray(StreamObjectHeaderStart header, byte[] byteArray, int startIndex)
Used to return the length of this element.protected abstract void
deserializeItemsFromByteArray(byte[] byteArray, AtomicInteger currentIndex, int lengthOfItems)
De-serialize items from byte array.static Set<StreamObjectTypeHeaderStart>
getCompoundTypes()
Gets the StreamObjectTypeHeaderStartstatic <T extends StreamObject>
TgetCurrent(byte[] byteArray, AtomicInteger index, Class<T> clazz)
Get current stream object.static Map<StreamObjectTypeHeaderStart,Class>
getStreamObjectTypeMapping()
Gets the StreamObjectTypeMappingstatic StreamObject
parseStreamObject(StreamObjectHeaderStart header, byte[] byteArray, AtomicInteger index)
Parse stream object from byte array.protected abstract int
serializeItemsToByteList(List<Byte> byteList)
Serialize items to byte list.List<Byte>
serializeToByteList()
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 Detail
-
StreamObject
protected StreamObject(StreamObjectTypeHeaderStart streamObjectType)
Initializes a new instance of the StreamObject class.- Parameters:
streamObjectType
- The instance of StreamObjectTypeHeaderStart.
-
-
Method Detail
-
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 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:
TikaException
IOException
-
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:
IOException
TikaException
-
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:
TikaException
IOException
-
serializeToByteList
public List<Byte> serializeToByteList() throws IOException, TikaException
Serialize item to byte list.- Specified by:
serializeToByteList
in interfaceIFSSHTTPBSerializable
- Returns:
- The byte list.
- Throws:
IOException
TikaException
-
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:
IOException
TikaException
-
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:
IOException
TikaException
-
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:
TikaException
IOException
-
-