Package biz.k11i.xgboost.util
Class ModelReader
- java.lang.Object
-
- biz.k11i.xgboost.util.ModelReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ModelReader extends java.lang.Object implements java.io.Closeable
Reads the Xgboost model from stream.
-
-
Constructor Summary
Constructors Constructor Description ModelReader(java.io.InputStream in)
ModelReader(java.lang.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()
private int
fillBuffer(int numBytes)
byte[]
readByteArray(int numBytes)
int
readByteAsInt()
double[]
readDoubleArrayBE(int numValues)
float
readFloat()
float[]
readFloatArray(int numValues)
int
readInt()
private int
readInt(java.nio.ByteOrder byteOrder)
int[]
readIntArray(int numValues)
int
readIntBE()
long
readLong()
java.lang.String
readString()
java.lang.String
readString(int numBytes)
int
readUnsignedInt()
java.lang.String
readUTF()
java.lang.String
readUTF(int utflen)
void
skip(long numBytes)
-
-
-
Method Detail
-
fillBuffer
private int fillBuffer(int numBytes) throws java.io.IOException
- Throws:
java.io.IOException
-
readByteAsInt
public int readByteAsInt() throws java.io.IOException
- Throws:
java.io.IOException
-
readByteArray
public byte[] readByteArray(int numBytes) throws java.io.IOException
- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException
- Throws:
java.io.IOException
-
readIntBE
public int readIntBE() throws java.io.IOException
- Throws:
java.io.IOException
-
readInt
private int readInt(java.nio.ByteOrder byteOrder) throws java.io.IOException
- Throws:
java.io.IOException
-
readIntArray
public int[] readIntArray(int numValues) throws java.io.IOException
- Throws:
java.io.IOException
-
readUnsignedInt
public int readUnsignedInt() throws java.io.IOException
- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException
- Throws:
java.io.IOException
-
asFloat
public float asFloat(byte[] bytes)
-
asUnsignedInt
public int asUnsignedInt(byte[] bytes) throws java.io.IOException
- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOException
- Throws:
java.io.IOException
-
readFloatArray
public float[] readFloatArray(int numValues) throws java.io.IOException
- Throws:
java.io.IOException
-
readDoubleArrayBE
public double[] readDoubleArrayBE(int numValues) throws java.io.IOException
- Throws:
java.io.IOException
-
skip
public void skip(long numBytes) throws java.io.IOException
- Throws:
java.io.IOException
-
readString
public java.lang.String readString() throws java.io.IOException
- Throws:
java.io.IOException
-
readString
public java.lang.String readString(int numBytes) throws java.io.IOException
- Throws:
java.io.IOException
-
readUTF
public java.lang.String readUTF() throws java.io.IOException
- Throws:
java.io.IOException
-
readUTF
public java.lang.String readUTF(int utflen) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-