|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.jsmat.primitive.MatPrimitive
public abstract class MatPrimitive
MatPrimitive is the abstract superclass for all primitive matlab types. These classes are used to read and write raw data. Typically, data consists of a type flag (4 bytes), the size of the block (4 bytes), the raw data block and some padding bytes if needed.
| Constructor Summary | |
|---|---|
MatPrimitive(MatType type)
Constructor with type constant |
|
| Method Summary | |
|---|---|
abstract int |
getArrayLength()
|
int |
getRawDataSize()
|
int |
getSize()
|
protected int |
getUnitSize()
|
void |
write(DataOutput out)
Writes the data block: type, raw size, raw data, padding (this order). |
protected abstract void |
writeBody(DataOutput out)
Writes the raw data block, without padding, type and size information |
static void |
writeEnd(MatType mType,
DataOutput out,
int rawDataSize)
|
static void |
writeStart(MatType mType,
DataOutput out,
int rawDataSize)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MatPrimitive(MatType type)
type - the type constant| Method Detail |
|---|
public int getRawDataSize()
getUnitSize() times getArrayLength()public abstract int getArrayLength()
getRawDataSize()
divided by getUnitSize(). this is usually the length
of the array storing the data in java
public static void writeStart(MatType mType,
DataOutput out,
int rawDataSize)
throws IOException
IOException
protected abstract void writeBody(DataOutput out)
throws IOException
out - the data output to write to
IOException - if any io exception occurs
public static void writeEnd(MatType mType,
DataOutput out,
int rawDataSize)
throws IOException
IOExceptionpublic int getSize()
public void write(DataOutput out)
throws IOException
writeBody(DataOutput) is called.
Equivalent to calling
writeStart(out);
writeBody(out);
writeEnd(out);
out - the data output to write to
IOException - if any io exception occursprotected int getUnitSize()
MatType.size
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||