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 TypeMethodDescriptionfloatasFloat(byte[] bytes) intasUnsignedInt(byte[] bytes) voidclose()private intfillBuffer(int numBytes) byte[]readByteArray(int numBytes) intdouble[]readDoubleArrayBE(int numValues) floatfloat[]readFloatArray(int numValues) intreadInt()private intint[]readIntArray(int numValues) intlongreadLong()readString(int numBytes) intreadUTF()readUTF(int utflen) voidskip(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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-