public abstract class Record extends java.lang.Object implements GenericRecord
Modifier and Type | Field and Description |
---|---|
protected static org.apache.logging.log4j.Logger |
LOG |
Constructor and Description |
---|
Record() |
Modifier and Type | Method and Description |
---|---|
static Record |
buildRecordAtOffset(byte[] b,
int offset)
Build and return the Record at the given offset.
|
static Record |
createRecordForType(long type,
byte[] b,
int start,
int len)
For a given type (little endian bytes 3 and 4 in record header),
byte array, start position and length:
will return a Record object that will handle that record
Remember that while PPT stores the record lengths as 8 bytes short
(not including the size of the header), this code assumes you're
passing in corrected lengths
|
static Record[] |
findChildRecords(byte[] b,
int start,
int len)
Default method for finding child records of a container record
|
abstract Record[] |
getChildRecords()
Fetch all the child records of this record
If this record is an atom, will return null
If this record is a non-atom, but has no children, will return
an empty array
|
java.util.List<Record> |
getGenericChildren() |
java.lang.Enum |
getGenericRecordType() |
abstract long |
getRecordType()
Returns the type (held as a little endian in bytes 3 and 4)
that this class handles
|
abstract boolean |
isAnAtom()
Is this record type an Atom record (only has data),
or is it a non-Atom record (has other records)?
|
static void |
writeLittleEndian(int i,
java.io.OutputStream o)
When writing out, write out a signed int (32bit) in Little Endian format
|
static void |
writeLittleEndian(short s,
java.io.OutputStream o)
When writing out, write out a signed short (16bit) in Little Endian format
|
abstract void |
writeOut(java.io.OutputStream o)
Have the contents printer out into an OutputStream, used when
writing a file back out to disk
(Normally, atom classes will keep their bytes around, but
non atom classes will just request the bytes from their
children, then chuck on their header and return)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGenericProperties
public abstract boolean isAnAtom()
public abstract long getRecordType()
public abstract Record[] getChildRecords()
public abstract void writeOut(java.io.OutputStream o) throws java.io.IOException
java.io.IOException
public java.lang.Enum getGenericRecordType()
getGenericRecordType
in interface GenericRecord
public java.util.List<Record> getGenericChildren()
getGenericChildren
in interface GenericRecord
public static void writeLittleEndian(int i, java.io.OutputStream o) throws java.io.IOException
java.io.IOException
public static void writeLittleEndian(short s, java.io.OutputStream o) throws java.io.IOException
java.io.IOException
public static Record buildRecordAtOffset(byte[] b, int offset)
b
- The byte array to build fromoffset
- The offset to build atpublic static Record[] findChildRecords(byte[] b, int start, int len)
public static Record createRecordForType(long type, byte[] b, int start, int len)
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.