org.mariadb.jdbc.internal.packet.dao.parameters

## Class ParameterWriter

- java.lang.Object
- - org.mariadb.jdbc.internal.packet.dao.parameters.ParameterWriter

    public class ParameterWriter
    extends Object

Helper class for serializing query parameters.

### Constructor Summary

Constructors
Constructor and Description
`ParameterWriter()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `write(OutputStream out, ArrayList<char[]> readArrays, boolean noBackslashEscapes)` Write cached reader char array to buffer.
`static void` `write(OutputStream out, BigDecimal bd)`
`static void` `write(OutputStream out, byte[] bytes, boolean noBackslashEscapes)` Write byte array in text format.
`static void` `write(OutputStream out, double value)`
`static void` `write(OutputStream out, InputStream is, boolean noBackslashEscapes)` Write stream in text format.
`static void` `write(OutputStream out, InputStream is, long length, boolean noBackslashEscapes)` Write stream in text format.
`static void` `write(OutputStream out, int value)`
`static void` `write(OutputStream out, long value)`
`static void` `write(OutputStream out, Reader reader, boolean noBackslashEscapes)` Write whole reader in text format.
`static void` `write(OutputStream out, Reader reader, long length, boolean noBackslashEscapes)` Write reader in text format.
`static void` `write(OutputStream out, String value, boolean noBackslashEscapes)` Write string in text format.
`static void` `writeBytesArray(OutputStream out, ArrayList<byte[]> readArrays, boolean noBackslashEscapes)` Write cache byte array to buffer.
`static void` `writeBytesEscaped(OutputStream out, byte[] bytes, boolean noBackslashEscapes)`
`static void` `writeDate(OutputStream out, Calendar calendar)` Write date in text format.
`static byte[]` `writeLittleEndian(int value)` Write integer to byte LittleEndian order.
`static void` `writeObject(OutputStream out, Object obj, boolean noBackslashEscapes)` Write object to buffer.
`static void` `writeTime(OutputStream out, Time time, Calendar calendar, boolean writeFractionalSeconds)` Write time in text format.
`static void` `writeTimestamp(OutputStream out, Timestamp ts, Calendar calendar, boolean writeFractionalSeconds)` Write timestamps in text format

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ParameterWriter

    public ParameterWriter()

### Method Detail

#### writeBytesEscaped

    public static void writeBytesEscaped(OutputStream out,
                                         byte[] bytes,
                                         boolean noBackslashEscapes)
                                  throws IOException

Throws:
  `IOException`

#### write

    public static void write(OutputStream out,
                             byte[] bytes,
                             boolean noBackslashEscapes)
                      throws IOException

Write byte array in text format.

Parameters:
  `out` - database stream
  `bytes` - byte arrayto send
  `noBackslashEscapes` - must backslash be escape
Throws:
  `IOException` - if any error occur when writing to database

#### write

    public static void write(OutputStream out,
                             String value,
                             boolean noBackslashEscapes)
                      throws IOException

Write string in text format.

Parameters:
  `out` - database stream
  `value` - String value to send
  `noBackslashEscapes` - must backslash be escape
Throws:
  `IOException` - if any error occur when writing to database

#### write

    public static void write(OutputStream out,
                             InputStream is,
                             boolean noBackslashEscapes)
                      throws IOException

Write stream in text format.

Parameters:
  `out` - database stream
  `is` - input stream to write
  `noBackslashEscapes` - must backslash be escape
Throws:
  `IOException` - if any error occur when writing to database

#### write

    public static void write(OutputStream out,
                             InputStream is,
                             long length,
                             boolean noBackslashEscapes)
                      throws IOException

Write stream in text format.

Parameters:
  `out` - database stream
  `is` - input stream to write
  `length` - max inputstream length to write
  `noBackslashEscapes` - must backslash be escape
Throws:
  `IOException` - if any error occur when writing to database

#### write

    public static void write(OutputStream out,
                             Reader reader,
                             boolean noBackslashEscapes)
                      throws IOException

Write whole reader in text format.

Parameters:
  `out` - database stream
  `reader` - reader to write
  `noBackslashEscapes` - must backslash be escape
Throws:
  `IOException` - if any error occur when writing to database

#### write

    public static void write(OutputStream out,
                             ArrayList<char[]> readArrays,
                             boolean noBackslashEscapes)
                      throws IOException

Write cached reader char array to buffer.

Parameters:
  `out` - output buffer
  `readArrays` - cache char array
  `noBackslashEscapes` - backslash must be escape flag
Throws:
  `IOException` - if error occur when writing to buffer

#### write

    public static void write(OutputStream out,
                             Reader reader,
                             long length,
                             boolean noBackslashEscapes)
                      throws IOException

Write reader in text format.

Parameters:
  `out` - database stream
  `reader` - reader to write
  `length` - reader max length to write
  `noBackslashEscapes` - must backslash be escape
Throws:
  `IOException` - if any error occur when writing to database

#### write

    public static void write(OutputStream out,
                             int value)
                      throws IOException

Throws:
  `IOException`

#### write

    public static void write(OutputStream out,
                             long value)
                      throws IOException

Throws:
  `IOException`

#### write

    public static void write(OutputStream out,
                             double value)
                      throws IOException

Throws:
  `IOException`

#### write

    public static void write(OutputStream out,
                             BigDecimal bd)
                      throws IOException

Throws:
  `IOException`

#### writeBytesArray

    public static void writeBytesArray(OutputStream out,
                                       ArrayList<byte[]> readArrays,
                                       boolean noBackslashEscapes)
                                throws IOException

Write cache byte array to buffer.

Parameters:
  `out` - buffer
  `readArrays` - cache byte array
  `noBackslashEscapes` - must escape backslash flag
Throws:
  `IOException` - if error occur writing buffer

#### writeDate

    public static void writeDate(OutputStream out,
                                 Calendar calendar)
                          throws IOException

Write date in text format.

Parameters:
  `out` - database stream
  `calendar` - session calendar
Throws:
  `IOException` - if any error occur when writing to database

#### writeTimestamp

    public static void writeTimestamp(OutputStream out,
                                      Timestamp ts,
                                      Calendar calendar,
                                      boolean writeFractionalSeconds)
                               throws IOException

Write timestamps in text format

Parameters:
  `out` - database outputstream
  `ts` - timestamp to write
  `calendar` - session calendar
  `writeFractionalSeconds` - must fractional seconds be send to database
Throws:
  `IOException` - if any error occur when writing to database.

#### writeTime

    public static void writeTime(OutputStream out,
                                 Time time,
                                 Calendar calendar,
                                 boolean writeFractionalSeconds)
                          throws IOException

Write time in text format.

Parameters:
  `out` - database outputStream
  `time` - time to write
  `calendar` - session calendar
  `writeFractionalSeconds` - must fractional seconds be send to database
Throws:
  `IOException` - if any error occur when writing to database.

#### writeObject

    public static void writeObject(OutputStream out,
                                   Object obj,
                                   boolean noBackslashEscapes)
                            throws IOException

Write object to buffer.

Parameters:
  `out` - outputStream
  `obj` - Object to send
  `noBackslashEscapes` - must back slash be escaped
Throws:
  `IOException` - if any connection error occued

#### writeLittleEndian

    public static byte[] writeLittleEndian(int value)

Write integer to byte LittleEndian order.

Parameters:
  `value` - int value to convert
Returns:
  byte array