A Matroska element. More...
Public Member Functions | |
byte[] | getBytes () |
Serializes to a byte array. More... | |
abstract byte[] | getId () |
Gets the EBML ID. More... | |
int | getLength () |
Gets the total length of the element (including ID/size field), set after calling fm.liveswitch.matroska.Element#getBytes. More... | |
int | getSize () |
Gets the size of the element (excluding ID/size field), set after calling fm.liveswitch.matroska.Element#getBytes. More... | |
int | getSizeLength () |
Gets the length of the size field, in bytes. More... | |
boolean | getWriteDefaultValues () |
Gets whether to include default values when serializing. More... | |
void | setSizeLength (int value) |
Sets the length of the size field, in bytes. More... | |
void | setWriteDefaultValues (boolean value) |
Sets whether to include default values when serializing. More... | |
Static Public Member Functions | |
static boolean | compare (byte[] bytes1, byte[] bytes2) |
Compares two byte arrays for equality. More... | |
static boolean | readBool (byte[] value) |
Reads a boolean element from the stream. More... | |
static java.util.Date | readDate (byte[] value) |
Reads a date string element from the stream. More... | |
static double | readDouble (byte[] value) |
Reads a double element from the stream. More... | |
static float | readFloat (byte[] value) |
Reads a float element from the stream. More... | |
static fm.liveswitch.Guid | readGuid (byte[] value) |
Reads a GUID element from the stream. More... | |
static byte[] | readId (byte[] bytes, int offset, fm.liveswitch.IntegerHolder offsetPlus) |
Reads a binary ID from the stream. More... | |
static long | readSignedInteger (byte[] value) |
Reads a signed integer element from the byte array. More... | |
static String | readString (byte[] value) |
Reads an ASCII string element from the stream. More... | |
static long | readUnsignedInteger (byte[] value) |
Reads an unsigned integer element from the byte array. More... | |
static String | readUtf8 (byte[] value) |
Reads a UTF-8 string element from the stream. More... | |
static byte[] | readValue (byte[] bytes, int offset, fm.liveswitch.IntegerHolder offsetPlus) |
Reads a binary value from the stream. More... | |
static long | readVariableInteger (byte[] bytes, int offset, fm.liveswitch.IntegerHolder offsetPlus) |
Reads a variable integer ("vint") from the byte array. More... | |
static byte[] | serializeVariableInteger (long value) |
Serializes a variable integer. More... | |
static byte[] | serializeVariableInteger (long value, int length) |
Serializes a variable integer using a fixed length. More... | |
Protected Member Functions | |
Element () | |
abstract byte[] | getInnerBytes () |
Gets the inner bytes. More... | |
void | write (byte[] value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes a binary element to the stream. More... | |
void | writeBool (boolean value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes a boolean element to the stream. More... | |
void | writeDate (java.util.Date value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes a date element to the stream. More... | |
void | writeDouble (double value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes a double element to the stream. More... | |
void | writeFloat (float value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes a float element to the stream. More... | |
void | writeGuid (fm.liveswitch.Guid value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes a GUID element to the stream. More... | |
void | writeSignedInteger (long value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes an signed integer element to the stream. More... | |
void | writeString (String value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes an ASCII string element to the stream. More... | |
void | writeUnsignedInteger (long value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes an unsigned integer element to the stream. More... | |
void | writeUtf8 (String value, byte[] idValue, fm.liveswitch.ByteOutputStream stream) |
Writes a UTF-8 string element to the stream. More... | |
void | writeVariableInteger (long value, fm.liveswitch.ByteOutputStream stream) |
Writes a variable integer ("vint") to the stream. More... | |
void | writeVariableInteger (long value, fm.liveswitch.ByteOutputStream stream, int length) |
Writes a variable integer ("vint") to the stream using a fixed length. More... | |
A Matroska element.
|
protected |
|
static |
Compares two byte arrays for equality.
bytes1 | The first byte array. |
bytes2 | The second byte array. |
byte [] fm.liveswitch.matroska.Element.getBytes | ( | ) |
Serializes to a byte array.
|
abstract |
Gets the EBML ID.
Reimplemented in fm.liveswitch.matroska.Video, fm.liveswitch.matroska.TrackEntry, fm.liveswitch.matroska.Track, fm.liveswitch.matroska.Tags, fm.liveswitch.matroska.SimpleBlock, fm.liveswitch.matroska.SegmentInfo, fm.liveswitch.matroska.Segment, fm.liveswitch.matroska.SeekHead, fm.liveswitch.matroska.Seek, fm.liveswitch.matroska.EbmlVoid, fm.liveswitch.matroska.EbmlCrc32, fm.liveswitch.matroska.Ebml, fm.liveswitch.matroska.Cues, fm.liveswitch.matroska.ContentEncodings, fm.liveswitch.matroska.ContentEncoding, fm.liveswitch.matroska.ContentCompression, fm.liveswitch.matroska.Cluster, fm.liveswitch.matroska.Chapters, fm.liveswitch.matroska.BlockGroup, fm.liveswitch.matroska.BlockAdditions, fm.liveswitch.matroska.Block, fm.liveswitch.matroska.Audio, and fm.liveswitch.matroska.Attachments.
|
abstractprotected |
Gets the inner bytes.
Reimplemented in fm.liveswitch.matroska.Video, fm.liveswitch.matroska.TrackEntry, fm.liveswitch.matroska.Track, fm.liveswitch.matroska.Tags, fm.liveswitch.matroska.SegmentInfo, fm.liveswitch.matroska.Segment, fm.liveswitch.matroska.SeekHead, fm.liveswitch.matroska.Seek, fm.liveswitch.matroska.EbmlVoid, fm.liveswitch.matroska.EbmlCrc32, fm.liveswitch.matroska.Ebml, fm.liveswitch.matroska.Cues, fm.liveswitch.matroska.ContentEncodings, fm.liveswitch.matroska.ContentEncoding, fm.liveswitch.matroska.ContentCompression, fm.liveswitch.matroska.Cluster, fm.liveswitch.matroska.Chapters, fm.liveswitch.matroska.BlockGroup, fm.liveswitch.matroska.BlockAdditions, fm.liveswitch.matroska.Block, fm.liveswitch.matroska.Audio, and fm.liveswitch.matroska.Attachments.
int fm.liveswitch.matroska.Element.getLength | ( | ) |
Gets the total length of the element (including ID/size field), set after calling fm.liveswitch.matroska.Element#getBytes.
int fm.liveswitch.matroska.Element.getSize | ( | ) |
Gets the size of the element (excluding ID/size field), set after calling fm.liveswitch.matroska.Element#getBytes.
int fm.liveswitch.matroska.Element.getSizeLength | ( | ) |
Gets the length of the size field, in bytes.
Defaults to zero (variable size).
boolean fm.liveswitch.matroska.Element.getWriteDefaultValues | ( | ) |
Gets whether to include default values when serializing.
|
static |
Reads a boolean element from the stream.
value | The value. |
|
static |
Reads a date string element from the stream.
value | The value. |
|
static |
Reads a double element from the stream.
value | The value. |
|
static |
Reads a float element from the stream.
value | The value. |
|
static |
Reads a GUID element from the stream.
value | The value. |
|
static |
Reads a binary ID from the stream.
bytes | The byte array. |
offset | The offset into the byte array. |
offsetPlus | The offset plus the amount read. |
|
static |
Reads a signed integer element from the byte array.
value | The value. |
|
static |
Reads an ASCII string element from the stream.
value | The value. |
|
static |
Reads an unsigned integer element from the byte array.
value | The value. |
|
static |
Reads a UTF-8 string element from the stream.
value | The value. |
|
static |
Reads a binary value from the stream.
bytes | The byte array. |
offset | The offset into the byte array. |
offsetPlus | The offset plus the amount read. |
|
static |
Reads a variable integer ("vint") from the byte array.
bytes | The byte array. |
offset | The offset into the byte array. |
offsetPlus | The offset plus the amount read. |
|
static |
Serializes a variable integer.
value | The value. |
|
static |
Serializes a variable integer using a fixed length.
value | The value. |
length | The length to use. |
void fm.liveswitch.matroska.Element.setSizeLength | ( | int | value | ) |
Sets the length of the size field, in bytes.
Defaults to zero (variable size).
void fm.liveswitch.matroska.Element.setWriteDefaultValues | ( | boolean | value | ) |
Sets whether to include default values when serializing.
|
protected |
Writes a binary element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes a boolean element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes a date element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes a double element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes a float element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes a GUID element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes an signed integer element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes an ASCII string element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes an unsigned integer element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes a UTF-8 string element to the stream.
value | The value to write. |
idValue | The ID of the value. |
stream | The stream to write. |
|
protected |
Writes a variable integer ("vint") to the stream.
value | The value to write. |
stream | The stream to write. |
|
protected |
Writes a variable integer ("vint") to the stream using a fixed length.
value | The value to write. |
stream | The stream to write. |
length | The length to use. |