Package org.apache.sysds.runtime.util
Class FastBufferedDataInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.sysds.runtime.util.FastBufferedDataInputStream
-
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable,MatrixBlockDataInput
public class FastBufferedDataInputStream extends FilterInputStream implements DataInput, MatrixBlockDataInput
-
-
Constructor Summary
Constructors Constructor Description FastBufferedDataInputStream(InputStream in)FastBufferedDataInputStream(InputStream in, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()longreadDoubleArray(int len, double[] varr)Reads the double array from the data input into the given dense block and returns the number of non-zeros.floatreadFloat()voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)intreadInt()StringreadLine()longreadLong()shortreadShort()longreadSparseRows(int rlen, long nnz, SparseBlock rows)Reads the sparse rows array from the data input into a sparse block and returns the number of non-zeros.intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()intskipBytes(int n)-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
FastBufferedDataInputStream
public FastBufferedDataInputStream(InputStream in)
-
FastBufferedDataInputStream
public FastBufferedDataInputStream(InputStream in, int size)
-
-
Method Detail
-
readFully
public void readFully(byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
public byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
public short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
public char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
public int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
public long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
public float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
public double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readLine
public String readLine() throws IOException
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
readDoubleArray
public long readDoubleArray(int len, double[] varr) throws IOExceptionDescription copied from interface:MatrixBlockDataInputReads the double array from the data input into the given dense block and returns the number of non-zeros.- Specified by:
readDoubleArrayin interfaceMatrixBlockDataInput- Parameters:
len- ?varr- ?- Returns:
- number of non-zeros
- Throws:
IOException- if IOException occurs
-
readSparseRows
public long readSparseRows(int rlen, long nnz, SparseBlock rows) throws IOExceptionDescription copied from interface:MatrixBlockDataInputReads the sparse rows array from the data input into a sparse block and returns the number of non-zeros.- Specified by:
readSparseRowsin interfaceMatrixBlockDataInput- Parameters:
rlen- number of rowsnnz- number of non-zerosrows- sparse block- Returns:
- number of non-zeros
- Throws:
IOException- if IOExcepton occurs
-
-