BinDrvReader
- java.lang.Object
-
- com.dashoptimization.BinDrvReader
-
public class BinDrvReader extends java.lang.ObjectA class to read Mosel's 'bin' data
-
-
Field Summary
Modifier and Type Field and Description static intCTRL_CLOSELSTstatic intCTRL_CLOSENDXstatic intCTRL_LABELstatic intCTRL_OPENLSTstatic intCTRL_OPENNDXstatic intCTRL_SKIPstatic intTYP_BOOLstatic intTYP_CTRLstatic intTYP_INTstatic intTYP_INTMstatic intTYP_INTPstatic intTYP_LONGstatic intTYP_REALstatic intTYP_STRstatic intTYP_VOID
-
Constructor Summary
Constructor and Description BinDrvReader(java.io.InputStream inf)Create a 'BinDrvReader' from an InputStream setting UTF-8 as the encoding.BinDrvReader(java.io.InputStream inf, java.lang.String enc)Create a 'BinDrvReader' from an InputStream.
-
Method Summary
Modifier and Type Method and Description booleangetBoolean()Read a Boolean from the input stream.static booleangetBoolean(java.nio.ByteBuffer bb)Read a Boolean from given buffer.intgetControl()Read a control code from the input stream.static intgetControl(java.nio.ByteBuffer bb)Read a control code from given buffer.intgetInt()Read an integer from the input stream.static intgetInt(java.nio.ByteBuffer bb)Read an integer from given buffer.longgetLong()Read a long integer from the input stream.static longgetLong(java.nio.ByteBuffer bb)Read a long integer from given buffer.doublegetReal()Read a real (double) from the input stream.static doublegetReal(java.nio.ByteBuffer bb)Read a real (double) from given buffer.java.lang.StringgetString()Read a text string from the input stream.static java.lang.StringgetString(java.nio.ByteBuffer bb)Read a text string from the given buffer using the UTF-8 encoding.static java.lang.StringgetString(java.nio.ByteBuffer bb, java.lang.String enc)Read a text string from given buffer.intnextToken()Get the type of the next available token.static intnextToken(java.nio.ByteBuffer bb)Get the type of the next available token.
-
-
-
Field Detail
-
TYP_INTP
public static final int TYP_INTP
- See Also:
- Constant Field Values
-
TYP_INTM
public static final int TYP_INTM
- See Also:
- Constant Field Values
-
TYP_INT
public static final int TYP_INT
- See Also:
- Constant Field Values
-
TYP_VOID
public static final int TYP_VOID
- See Also:
- Constant Field Values
-
TYP_REAL
public static final int TYP_REAL
- See Also:
- Constant Field Values
-
TYP_STR
public static final int TYP_STR
- See Also:
- Constant Field Values
-
TYP_BOOL
public static final int TYP_BOOL
- See Also:
- Constant Field Values
-
TYP_CTRL
public static final int TYP_CTRL
- See Also:
- Constant Field Values
-
TYP_LONG
public static final int TYP_LONG
- See Also:
- Constant Field Values
-
CTRL_SKIP
public static final int CTRL_SKIP
- See Also:
- Constant Field Values
-
CTRL_LABEL
public static final int CTRL_LABEL
- See Also:
- Constant Field Values
-
CTRL_OPENLST
public static final int CTRL_OPENLST
- See Also:
- Constant Field Values
-
CTRL_CLOSELST
public static final int CTRL_CLOSELST
- See Also:
- Constant Field Values
-
CTRL_OPENNDX
public static final int CTRL_OPENNDX
- See Also:
- Constant Field Values
-
CTRL_CLOSENDX
public static final int CTRL_CLOSENDX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BinDrvReader
public BinDrvReader(java.io.InputStream inf, java.lang.String enc)Create a 'BinDrvReader' from an InputStream.- Parameters:
-
inf- stream from which data is read -
enc- character encoding
-
BinDrvReader
public BinDrvReader(java.io.InputStream inf)
Create a 'BinDrvReader' from an InputStream setting UTF-8 as the encoding.- Parameters:
-
inf- stream from which data is read
-
-
Method Detail
-
nextToken
public int nextToken() throws java.io.IOExceptionGet the type of the next available token.- Returns:
-
the next token type or
-1in case of end of file - Throws:
-
java.io.IOException- in case of IO error
-
getInt
public int getInt() throws java.io.IOExceptionRead an integer from the input stream.- Returns:
- next integer
- Throws:
-
java.io.EOFException- if trying to read after the end of stream or an IOException in case of read error or the next token is not an integer -
java.io.IOException
-
getLong
public long getLong() throws java.io.IOExceptionRead a long integer from the input stream.- Returns:
- next long integer
- Throws:
-
java.io.EOFException- if trying to read after the end of stream or an IOException in case of read error or the next token is not an integer -
java.io.IOException
-
getReal
public double getReal() throws java.io.IOExceptionRead a real (double) from the input stream.- Returns:
- next real
- Throws:
-
java.io.EOFException- if trying to read after the end of stream or an IOException in case of read error or the next token is not a real -
java.io.IOException
-
getBoolean
public boolean getBoolean() throws java.io.IOExceptionRead a Boolean from the input stream.- Returns:
- next Boolean
- Throws:
-
java.io.EOFException- if trying to read after the end of stream or an IOException in case of read error or the next token is not a Boolean -
java.io.IOException
-
getString
public java.lang.String getString() throws java.io.IOExceptionRead a text string from the input stream.- Returns:
- next text string
- Throws:
-
java.io.EOFException- if trying to read after the end of stream or an IOException in case of read error or the next token is not a string -
java.io.IOException
-
getControl
public int getControl() throws java.io.IOExceptionRead a control code from the input stream.- Returns:
- next control code
- Throws:
-
java.io.EOFException- if trying to read after the end of stream or an IOException in case of read error or the next token is not a control code -
java.io.IOException
-
nextToken
public static int nextToken(java.nio.ByteBuffer bb)
Get the type of the next available token.- Parameters:
-
bb- buffer from where data is read - Returns:
-
the next token type or
-1in case of end of buffer
-
getInt
public static int getInt(java.nio.ByteBuffer bb) throws java.io.EOFExceptionRead an integer from given buffer.- Parameters:
-
bb- buffer from where data is read - Returns:
- next integer
- Throws:
-
java.io.EOFException- if trying to read after the end of the buffer or a RuntimeException in case the next token is not an integer
-
getLong
public static long getLong(java.nio.ByteBuffer bb) throws java.io.EOFExceptionRead a long integer from given buffer.- Parameters:
-
bb- buffer from where data is read - Returns:
- next long integer
- Throws:
-
java.io.EOFException- if trying to read after the end of the buffer or a RuntimeException in case the next token is not an integer
-
getReal
public static double getReal(java.nio.ByteBuffer bb) throws java.io.EOFExceptionRead a real (double) from given buffer.- Parameters:
-
bb- buffer from where data is read - Returns:
- next real
- Throws:
-
java.io.EOFException- if trying to read after the end of the buffer or a RuntimeException in case the next token is not a real
-
getBoolean
public static boolean getBoolean(java.nio.ByteBuffer bb) throws java.io.EOFExceptionRead a Boolean from given buffer.- Parameters:
-
bb- buffer from where data is read - Returns:
- next Boolean
- Throws:
-
java.io.EOFException- if trying to read after the end of the buffer or a RuntimeException in case the next token is not a Boolean
-
getString
public static java.lang.String getString(java.nio.ByteBuffer bb, java.lang.String enc) throws java.io.EOFExceptionRead a text string from given buffer.- Parameters:
-
bb- buffer from where data is read -
enc- character encoding - Returns:
- next text string
- Throws:
-
java.io.EOFException- if trying to read after the end of the buffer or a RuntimeException in case the next token is not a string
-
getString
public static java.lang.String getString(java.nio.ByteBuffer bb) throws java.io.EOFExceptionRead a text string from the given buffer using the UTF-8 encoding.- Parameters:
-
bb- buffer from where data is read - Returns:
- next text string
- Throws:
-
java.io.EOFException- if trying to read after the end of the buffer or a RuntimeException in case the next token is not a string
-
getControl
public static int getControl(java.nio.ByteBuffer bb) throws java.io.EOFExceptionRead a control code from given buffer.- Parameters:
-
bb- buffer from where data is read - Returns:
- next control code
- Throws:
-
java.io.EOFException- if trying to read after the end of the buffer or a RuntimeException in case the next token is not a control code
-
-
© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.
