Class CacheDataOutput
- java.lang.Object
-
- org.apache.sysds.runtime.controlprogram.caching.CacheDataOutput
-
- All Implemented Interfaces:
DataOutput
,MatrixBlockDataOutput
public class CacheDataOutput extends Object implements DataOutput, MatrixBlockDataOutput
Custom DataOutput to serialize directly into the given byte array.
-
-
Constructor Summary
Constructors Constructor Description CacheDataOutput(byte[] mem)
CacheDataOutput(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBytes()
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)
void
writeBoolean(boolean v)
void
writeByte(int v)
void
writeBytes(String s)
void
writeChar(int v)
void
writeChars(String s)
void
writeDouble(double v)
void
writeDoubleArray(int len, double[] varr)
Writes the double array of a dense block to the data output.void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeShort(int v)
void
writeSparseRows(int rlen, SparseBlock rows)
Writes the sparse rows array of a sparse block to the data output.void
writeUTF(String s)
-
-
-
Method Detail
-
write
public void write(int b) throws IOException
- Specified by:
write
in interfaceDataOutput
- Throws:
IOException
-
write
public void write(byte[] b) throws IOException
- Specified by:
write
in interfaceDataOutput
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException
- Specified by:
write
in interfaceDataOutput
- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean v) throws IOException
- Specified by:
writeBoolean
in interfaceDataOutput
- Throws:
IOException
-
writeInt
public void writeInt(int v) throws IOException
- Specified by:
writeInt
in interfaceDataOutput
- Throws:
IOException
-
writeDouble
public void writeDouble(double v) throws IOException
- Specified by:
writeDouble
in interfaceDataOutput
- Throws:
IOException
-
writeByte
public void writeByte(int v) throws IOException
- Specified by:
writeByte
in interfaceDataOutput
- Throws:
IOException
-
writeBytes
public void writeBytes(String s) throws IOException
- Specified by:
writeBytes
in interfaceDataOutput
- Throws:
IOException
-
writeChar
public void writeChar(int v) throws IOException
- Specified by:
writeChar
in interfaceDataOutput
- Throws:
IOException
-
writeChars
public void writeChars(String s) throws IOException
- Specified by:
writeChars
in interfaceDataOutput
- Throws:
IOException
-
writeFloat
public void writeFloat(float v) throws IOException
- Specified by:
writeFloat
in interfaceDataOutput
- Throws:
IOException
-
writeLong
public void writeLong(long v) throws IOException
- Specified by:
writeLong
in interfaceDataOutput
- Throws:
IOException
-
writeShort
public void writeShort(int v) throws IOException
- Specified by:
writeShort
in interfaceDataOutput
- Throws:
IOException
-
writeUTF
public void writeUTF(String s) throws IOException
- Specified by:
writeUTF
in interfaceDataOutput
- Throws:
IOException
-
writeDoubleArray
public void writeDoubleArray(int len, double[] varr) throws IOException
Description copied from interface:MatrixBlockDataOutput
Writes the double array of a dense block to the data output.- Specified by:
writeDoubleArray
in interfaceMatrixBlockDataOutput
- Parameters:
len
- ?varr
- ?- Throws:
IOException
- if IOException occurs
-
writeSparseRows
public void writeSparseRows(int rlen, SparseBlock rows) throws IOException
Description copied from interface:MatrixBlockDataOutput
Writes the sparse rows array of a sparse block to the data output.- Specified by:
writeSparseRows
in interfaceMatrixBlockDataOutput
- Parameters:
rlen
- ?rows
- sparse block- Throws:
IOException
- if IOException occurs
-
getBytes
public byte[] getBytes()
-
-