ExHyperlinkAtompublic class ExHyperlinkAtom extends RecordAtom Tne atom that holds metadata on a specific Link in the document.
(The actual link is held in a sibling CString record) |
Fields Summary |
---|
private byte[] | _headerRecord header. | private byte[] | _dataRecord data. |
Constructors Summary |
---|
protected ExHyperlinkAtom()Constructs a brand new link related atom record.
_header = new byte[8];
_data = new byte[4];
LittleEndian.putShort(_header, 2, (short)getRecordType());
LittleEndian.putInt(_header, 4, _data.length);
// It is fine for the other values to be zero
| protected ExHyperlinkAtom(byte[] source, int start, int len)Constructs the link related atom record from its
source data.
// Get the header.
_header = new byte[8];
System.arraycopy(source,start,_header,0,8);
// Get the record data.
_data = new byte[len-8];
System.arraycopy(source,start+8,_data,0,len-8);
// Must be at least 4 bytes long
if(_data.length < 4) {
throw new IllegalArgumentException("The length of the data for a ExHyperlinkAtom must be at least 4 bytes, but was only " + _data.length);
}
|
Methods Summary |
---|
public int | getNumber()Gets the link number. This will match the one in the
InteractiveInfoAtom which uses the link.
return LittleEndian.getInt(_data,0);
| public long | getRecordType()Gets the record type. return RecordTypes.ExHyperlinkAtom.typeID;
| public void | setNumber(int number)Sets the link number
LittleEndian.putInt(_data,0,number);
| public void | writeOut(java.io.OutputStream out)Write the contents of the record back, so it can be written
to disk
out.write(_header);
out.write(_data);
|
|