Package biz.k11i.xgboost.util
Class ModelReader
- java.lang.Object
-
- biz.k11i.xgboost.util.ModelReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ModelReader extends Object implements Closeable
Reads the Xgboost model from stream.
-
-
Constructor Summary
Constructors Constructor Description ModelReader(InputStream in)
ModelReader(String filename)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
asFloat(byte[] bytes)
int
asUnsignedInt(byte[] bytes)
void
close()
byte[]
readByteArray(int numBytes)
int
readByteAsInt()
double[]
readDoubleArrayBE(int numValues)
float
readFloat()
float[]
readFloatArray(int numValues)
int
readInt()
int[]
readIntArray(int numValues)
int
readIntBE()
long
readLong()
String
readString()
String
readString(int numBytes)
int
readUnsignedInt()
String
readUTF()
String
readUTF(int utflen)
void
skip(long numBytes)
-
-
-
Constructor Detail
-
ModelReader
@Deprecated public ModelReader(String filename) throws IOException
Deprecated.- Throws:
IOException
-
ModelReader
public ModelReader(InputStream in) throws IOException
- Throws:
IOException
-
-
Method Detail
-
readByteAsInt
public int readByteAsInt() throws IOException
- Throws:
IOException
-
readByteArray
public byte[] readByteArray(int numBytes) throws IOException
- Throws:
IOException
-
readInt
public int readInt() throws IOException
- Throws:
IOException
-
readIntBE
public int readIntBE() throws IOException
- Throws:
IOException
-
readIntArray
public int[] readIntArray(int numValues) throws IOException
- Throws:
IOException
-
readUnsignedInt
public int readUnsignedInt() throws IOException
- Throws:
IOException
-
readLong
public long readLong() throws IOException
- Throws:
IOException
-
asFloat
public float asFloat(byte[] bytes)
-
asUnsignedInt
public int asUnsignedInt(byte[] bytes) throws IOException
- Throws:
IOException
-
readFloat
public float readFloat() throws IOException
- Throws:
IOException
-
readFloatArray
public float[] readFloatArray(int numValues) throws IOException
- Throws:
IOException
-
readDoubleArrayBE
public double[] readDoubleArrayBE(int numValues) throws IOException
- Throws:
IOException
-
skip
public void skip(long numBytes) throws IOException
- Throws:
IOException
-
readString
public String readString() throws IOException
- Throws:
IOException
-
readString
public String readString(int numBytes) throws IOException
- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Throws:
IOException
-
readUTF
public String readUTF(int utflen) throws IOException
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-