public abstract class StreamObject extends Object implements IFSSHTTPBSerializable
Modifier | Constructor and Description |
---|---|
protected |
StreamObject(StreamObjectTypeHeaderStart streamObjectType)
Initializes a new instance of the StreamObject class.
|
Modifier and Type | Method and 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 StreamObjectTypeHeaderStart
|
static <T extends StreamObject> |
getCurrent(byte[] byteArray,
AtomicInteger index,
Class<T> clazz)
Get current stream object.
|
static Map<StreamObjectTypeHeaderStart,Class> |
getStreamObjectTypeMapping()
Gets the StreamObjectTypeMapping
|
static 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> |
tryGetCurrent(byte[] byteArray,
AtomicInteger index,
AtomicReference<T> streamObject,
Class<T> clazz)
Try to get current object, true will returned if success.
|
protected StreamObject(StreamObjectTypeHeaderStart streamObjectType)
streamObjectType
- The instance of StreamObjectTypeHeaderStart.public static Set<StreamObjectTypeHeaderStart> getCompoundTypes()
public static Map<StreamObjectTypeHeaderStart,Class> getStreamObjectTypeMapping()
public static <T extends StreamObject> T getCurrent(byte[] byteArray, AtomicInteger index, Class<T> clazz) throws TikaException, IOException
byteArray
- The byte array which contains message.index
- The position where to start.TikaException
IOException
public static StreamObject parseStreamObject(StreamObjectHeaderStart header, byte[] byteArray, AtomicInteger index) throws IOException, TikaException
header
- The instance of StreamObjectHeaderStart.byteArray
- The byte array.index
- The position where to start.IOException
TikaException
public static <T extends StreamObject> boolean tryGetCurrent(byte[] byteArray, AtomicInteger index, AtomicReference<T> streamObject, Class<T> clazz) throws TikaException, IOException
byteArray
- The byte array.index
- The position where to start.streamObject
- The instance that want to get.TikaException
IOException
public List<Byte> serializeToByteList() throws IOException, TikaException
serializeToByteList
in interface IFSSHTTPBSerializable
IOException
TikaException
public int deserializeFromByteArray(StreamObjectHeaderStart header, byte[] byteArray, int startIndex) throws IOException, TikaException
header
- Then instance of StreamObjectHeaderStart.byteArray
- The byte liststartIndex
- The position where to start.IOException
TikaException
protected abstract int serializeItemsToByteList(List<Byte> byteList) throws IOException, TikaException
byteList
- The byte list need to serialized.IOException
TikaException
protected abstract void deserializeItemsFromByteArray(byte[] byteArray, AtomicInteger currentIndex, int lengthOfItems) throws TikaException, IOException
byteArray
- The byte array which contains response message.currentIndex
- The index special where to start.lengthOfItems
- The length of items.TikaException
IOException
Copyright © 2007–2023 The Apache Software Foundation. All rights reserved.