public class MatFileHeader extends Object
| Modifier and Type | Field and Description |
|---|---|
static ByteOrder |
DEFAULT_ENDIAN |
static int |
DEFAULT_VERSION |
| Constructor and Description |
|---|
MatFileHeader(String description,
int version,
ByteOrder byteOrder)
New MAT-file header
|
| Modifier and Type | Method and Description |
|---|---|
static MatFileHeader |
createHeader()
A factory.
|
ByteOrder |
getByteOrder() |
String |
getDescription()
Gets descriptive text
|
byte[] |
getEndianIndicator()
Gets endian indicator.
|
int |
getVersion()
When creating a MAT-file, set version to 0x0100
|
static ByteOrder |
parseByteOrder(byte[] endianIndicator)
Parses out the byte order based on a byte array containing
either 'MI' (big-endian) or 'IM' (little-endian).
|
static MatFileHeader |
parseFrom(String description,
byte[] bversion,
byte[] endianIndicator)
Parses a MatFileHeader from its desciption and the raw bytes of the version and endian indicator.
|
String |
toString() |
public static final int DEFAULT_VERSION
public static final ByteOrder DEFAULT_ENDIAN
public MatFileHeader(String description, int version, ByteOrder byteOrder)
description - - descriptive text (no longer than 116 characters)version - - by default is set to 0x0100endianIndicator - - byte array size of 2 indicating byte-swapping requirementpublic static MatFileHeader parseFrom(String description, byte[] bversion, byte[] endianIndicator)
description - - descriptive testbversion - - 2-byte array containing the version (raw from a MAT-File)endianIndicator - - 2-byte array containing the endian indicator (raw from a MAT-File(public static ByteOrder parseByteOrder(byte[] endianIndicator)
endianIndicator - 2-byte long array holding the endian indicatorpublic String getDescription()
public byte[] getEndianIndicator()
public int getVersion()
public static MatFileHeader createHeader()
MatFileHeader instance with default header values:
MatFileHeader instancepublic ByteOrder getByteOrder()