Package biz.k11i.xgboost.util
Class ModelReader
java.lang.Object
biz.k11i.xgboost.util.ModelReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
Reads the Xgboost model from stream.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
asFloat
(byte[] bytes) int
asUnsignedInt
(byte[] bytes) void
close()
private int
fillBuffer
(int numBytes) byte[]
readByteArray
(int numBytes) int
double[]
readDoubleArrayBE
(int numValues) float
float[]
readFloatArray
(int numValues) int
readInt()
private int
int[]
readIntArray
(int numValues) int
long
readLong()
readString
(int numBytes) int
readUTF()
readUTF
(int utflen) void
skip
(long numBytes)
-
Field Details
-
stream
-
buffer
private byte[] buffer
-
-
Constructor Details
-
ModelReader
Deprecated.- Throws:
IOException
-
ModelReader
- Throws:
IOException
-
-
Method Details
-
fillBuffer
- Throws:
IOException
-
readByteAsInt
- Throws:
IOException
-
readByteArray
- Throws:
IOException
-
readInt
- Throws:
IOException
-
readIntBE
- Throws:
IOException
-
readInt
- Throws:
IOException
-
readIntArray
- Throws:
IOException
-
readUnsignedInt
- Throws:
IOException
-
readLong
- Throws:
IOException
-
asFloat
public float asFloat(byte[] bytes) -
asUnsignedInt
- Throws:
IOException
-
readFloat
- Throws:
IOException
-
readFloatArray
- Throws:
IOException
-
readDoubleArrayBE
- Throws:
IOException
-
skip
- Throws:
IOException
-
readString
- Throws:
IOException
-
readString
- Throws:
IOException
-
readUTF
- Throws:
IOException
-
readUTF
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-