Class ArrayReader
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.internal.parser.v0.ArrayReader
-
- All Implemented Interfaces:
IValueReader
final class ArrayReader extends java.lang.Object implements IValueReader
Reads an array with element of a certain type from a byte array.
-
-
Field Summary
Fields Modifier and Type Field Description private ChunkStructure
header
private IValueReader
reader
private static int
UNREASONABLE_ARRAY_LENGTH
-
Constructor Summary
Constructors Constructor Description ArrayReader(IValueReader reader, ChunkStructure header)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentType<?>
getValueType()
private static int
readArraySize(byte[] data, int offset)
java.lang.Object
readValue(byte[] bytes, Offset offset, long timestamp)
Reads an objects from a byte array starting at a given offset.
-
-
-
Field Detail
-
reader
private final IValueReader reader
-
header
private final ChunkStructure header
-
UNREASONABLE_ARRAY_LENGTH
private static final int UNREASONABLE_ARRAY_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArrayReader
ArrayReader(IValueReader reader, ChunkStructure header)
-
-
Method Detail
-
readValue
public java.lang.Object readValue(byte[] bytes, Offset offset, long timestamp) throws InvalidJfrFileException
Description copied from interface:IValueReader
Reads an objects from a byte array starting at a given offset.- Specified by:
readValue
in interfaceIValueReader
offset
- the offset to start read from. Will be moved to the end of the parsed datatimestamp
- the timestamp of the object to read- Returns:
- the parsed object
- Throws:
InvalidJfrFileException
-
readArraySize
private static int readArraySize(byte[] data, int offset) throws InvalidJfrFileException
- Throws:
InvalidJfrFileException
-
getValueType
public ContentType<?> getValueType()
- Specified by:
getValueType
in interfaceIValueReader
- Returns:
- the content type of the created objects
-
-