Package org.apache.poi.hslf.record
Class Record
java.lang.Object
org.apache.poi.hslf.record.Record
- Direct Known Subclasses:
RecordAtom
,RecordContainer
This abstract class represents a record in the PowerPoint document.
Record classes should extend with RecordContainer or RecordAtom, which
extend this in turn.
- Author:
- Nick Burch
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 lengthsstatic Record[]
findChildRecords
(byte[] b, int start, int len) Default method for finding child records of a container recordabstract Record[]
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 arrayabstract long
Returns the type (held as a little endian in bytes 3 and 4) that this class handlesabstract 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, OutputStream o) When writing out, write out a signed int (32bit) in Little Endian formatstatic void
writeLittleEndian
(short s, OutputStream o) When writing out, write out a signed short (16bit) in Little Endian formatabstract void
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)
-
Field Details
-
logger
-
-
Constructor Details
-
Record
public Record()
-
-
Method Details
-
isAnAtom
public abstract boolean isAnAtom()Is this record type an Atom record (only has data), or is it a non-Atom record (has other records)? -
getRecordType
public abstract long getRecordType()Returns the type (held as a little endian in bytes 3 and 4) that this class handles -
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 -
writeOut
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)- Throws:
IOException
-
writeLittleEndian
When writing out, write out a signed int (32bit) in Little Endian format- Throws:
IOException
-
writeLittleEndian
When writing out, write out a signed short (16bit) in Little Endian format- Throws:
IOException
-
buildRecordAtOffset
Build and return the Record at the given offset. Note - does less error checking and handling than findChildRecords- Parameters:
b
- The byte array to build fromoffset
- The offset to build at
-
findChildRecords
Default method for finding child records of a container record -
createRecordForType
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
-