BinDrvWriter
- java.lang.Object
-
- com.dashoptimization.BinDrvWriter
-
public class BinDrvWriter extends java.lang.ObjectA class to generate Mosel's 'bin' data
-
-
Field Summary
Modifier and Type Field and Description static intCTRL_CLOSELSTstatic intCTRL_CLOSENDXstatic intCTRL_LABELstatic intCTRL_LASTstatic intCTRL_OPENLSTstatic intCTRL_OPENNDXstatic intCTRL_SKIPstatic intTYP_BOOLstatic intTYP_CTRLstatic intTYP_DATAstatic intTYP_INTstatic intTYP_INTMstatic intTYP_INTPstatic intTYP_REALstatic intTYP_STR
-
Constructor Summary
Constructor and Description BinDrvWriter(java.io.OutputStream outf)Create a 'BinDrvWriter' from an OutputStream setting UTF-8 as the encoding.BinDrvWriter(java.io.OutputStream outf, java.lang.String enc)Create a 'BinDrvWriter' from an OutputStream.
-
Method Summary
Modifier and Type Method and Description BinDrvWriterput(boolean b)Write a Boolean to the output stream.BinDrvWriterput(byte[] bs)Write a data block to the output stream.BinDrvWriterput(byte[] bs, int off, int len)Write a data block to the output stream.static voidput(java.nio.ByteBuffer bb, boolean b)Append a Boolean to the given buffer.static voidput(java.nio.ByteBuffer bb, byte[] bs)Append a data block to the given buffer.static voidput(java.nio.ByteBuffer bb, byte[] bs, int off, int len)Append a data block to the given buffer.static voidput(java.nio.ByteBuffer bb, double r)Append a real (double) to the given buffer.static voidput(java.nio.ByteBuffer bb, int i)Append an integer to the given buffer.static voidput(java.nio.ByteBuffer bb, long i)Append a long integer to the given buffer.static voidput(java.nio.ByteBuffer bb, java.lang.String s)Append a text string to the given buffer using the UTF-8 encoding.static voidput(java.nio.ByteBuffer bb, java.lang.String s, java.lang.String enc)Append a text string to the given buffer.BinDrvWriterput(double r)Write a real (double) to the output stream.BinDrvWriterput(int i)Write an integer to the output stream.BinDrvWriterput(long i)Write a long integer to the output stream.BinDrvWriterput(java.lang.String s)Write a text string to the output stream.static voidputControl(java.nio.ByteBuffer bb, int c)Append a control code to the given buffer.BinDrvWriterputControl(int c)Write a control code to the output stream.
-
-
-
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_DATA
public static final int TYP_DATA
- 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
-
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
-
CTRL_LAST
public static final int CTRL_LAST
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BinDrvWriter
public BinDrvWriter(java.io.OutputStream outf, java.lang.String enc)Create a 'BinDrvWriter' from an OutputStream.- Parameters:
-
outf- stream to which data is written -
enc- character encoding
-
BinDrvWriter
public BinDrvWriter(java.io.OutputStream outf)
Create a 'BinDrvWriter' from an OutputStream setting UTF-8 as the encoding.- Parameters:
-
outf- stream to which data is written
-
-
Method Detail
-
put
public BinDrvWriter put(int i) throws java.io.IOException
Write an integer to the output stream.- Parameters:
-
i- value to write - Returns:
- the current writer
- Throws:
-
java.io.IOException- in case of IO error
-
put
public BinDrvWriter put(long i) throws java.io.IOException
Write a long integer to the output stream.- Parameters:
-
i- value to write - Returns:
- the current writer
- Throws:
-
java.io.IOException- in case of IO error
-
put
public BinDrvWriter put(double r) throws java.io.IOException
Write a real (double) to the output stream.- Parameters:
-
r- value to write - Returns:
- the current writer
- Throws:
-
java.io.IOException- in case of IO error
-
put
public BinDrvWriter put(boolean b) throws java.io.IOException
Write a Boolean to the output stream.- Parameters:
-
b- value to write - Returns:
- the current writer
- Throws:
-
java.io.IOException- in case of IO error
-
put
public BinDrvWriter put(java.lang.String s) throws java.io.IOException
Write a text string to the output stream.- Parameters:
-
s- value to write - Returns:
- the current writer
- Throws:
-
java.io.IOException- in case of IO error
-
put
public BinDrvWriter put(byte[] bs, int off, int len) throws java.io.IOException
Write a data block to the output stream.- Parameters:
-
bs- data to write -
off- start offset in the data -
len- number of bytes to write - Returns:
- the current writer
- Throws:
-
java.io.IOException- in case of IO error
-
put
public BinDrvWriter put(byte[] bs) throws java.io.IOException
Write a data block to the output stream.- Parameters:
-
bs- data to write - Returns:
- the current writer
- Throws:
-
java.io.IOException- in case of IO error
-
putControl
public BinDrvWriter putControl(int c) throws java.io.IOException
Write a control code to the output stream.- Parameters:
-
c- value to write - Returns:
- the current writer
- Throws:
-
java.io.IOException- in case of IO error
-
put
public static void put(java.nio.ByteBuffer bb, int i)Append an integer to the given buffer.- Parameters:
-
bb- destination buffer -
i- value to write
-
put
public static void put(java.nio.ByteBuffer bb, long i)Append a long integer to the given buffer.- Parameters:
-
bb- destination buffer -
i- value to write
-
put
public static void put(java.nio.ByteBuffer bb, double r)Append a real (double) to the given buffer.- Parameters:
-
bb- destination buffer -
r- value to write
-
put
public static void put(java.nio.ByteBuffer bb, boolean b)Append a Boolean to the given buffer.- Parameters:
-
bb- destination buffer -
b- value to write
-
put
public static void put(java.nio.ByteBuffer bb, java.lang.String s, java.lang.String enc)Append a text string to the given buffer.- Parameters:
-
bb- destination buffer -
s- value to write -
enc- character encoding
-
put
public static void put(java.nio.ByteBuffer bb, java.lang.String s)Append a text string to the given buffer using the UTF-8 encoding.- Parameters:
-
bb- destination buffer -
s- value to write
-
put
public static void put(java.nio.ByteBuffer bb, byte[] bs, int off, int len)Append a data block to the given buffer.- Parameters:
-
bb- destination buffer -
bs- data to write -
off- start offset in the data -
len- number of bytes to write
-
put
public static void put(java.nio.ByteBuffer bb, byte[] bs)Append a data block to the given buffer.- Parameters:
-
bb- destination buffer -
bs- data to write
-
putControl
public static void putControl(java.nio.ByteBuffer bb, int c)Append a control code to the given buffer.- Parameters:
-
bb- destination buffer -
c- value to write
-
-
