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

## Class ReaderParameter

- java.lang.Object
- - org.mariadb.jdbc.internal.packet.dao.parameters.ParameterHolder
  - - org.mariadb.jdbc.internal.packet.dao.parameters.LongDataParameterHolder
    - - org.mariadb.jdbc.internal.packet.dao.parameters.ReaderParameter

All Implemented Interfaces:
  Cloneable

    public class ReaderParameter
    extends LongDataParameterHolder

### Field Summary

### Fields inherited from class org.mariadb.jdbc.internal.packet.dao.parameters.LongDataParameterHolder

`mariaDbCharset`

### Constructor Summary

Constructors
Constructor and Description
`ReaderParameter(Reader reader, boolean noBackslashEscapes)`
`ReaderParameter(Reader reader, long length, boolean noBackslashEscapes)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `getApproximateTextProtocolLength()` Return approximated data calculated length for rewriting queries
`MariaDbType` `getMariaDbType()`
`boolean` `isLongData()`
`String` `toString()` Nice formatting of prepared statements using PreparedStatement.toString().
`void` `writeBinary(PacketOutputStream os)` Write reader to database in binary format.
`void` `writeTo(OutputStream os)` Write reader to database in text format.

### Methods inherited from class org.mariadb.jdbc.internal.packet.dao.parameters.LongDataParameterHolder

`isNotLongData, isNullParameter, setMariaDbServerCharset`

### Methods inherited from class org.mariadb.jdbc.internal.packet.dao.parameters.ParameterHolder

`writeBufferType`

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

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

### Constructor Detail

#### ReaderParameter

    public ReaderParameter(Reader reader,
                           long length,
                           boolean noBackslashEscapes)

Constructor.

Parameters:
  `reader` - reader to write
  `length` - max length to write (can be null)
  `noBackslashEscapes` - must backslash be escape

#### ReaderParameter

    public ReaderParameter(Reader reader,
                           boolean noBackslashEscapes)

### Method Detail

#### writeTo

    public void writeTo(OutputStream os)
                 throws IOException

Write reader to database in text format.

Specified by:
  `writeTo` in class `ParameterHolder`
Parameters:
  `os` - database outputStream
Throws:
  `IOException` - if any error occur when reading reader

#### getApproximateTextProtocolLength

    public long getApproximateTextProtocolLength()
                                          throws IOException

Return approximated data calculated length for rewriting queries

Specified by:
  `getApproximateTextProtocolLength` in class `ParameterHolder`
Returns:
  approximated data length.
Throws:
  `IOException` - if error reading stream

#### writeBinary

    public void writeBinary(PacketOutputStream os)
                     throws IOException

Write reader to database in binary format.

Specified by:
  `writeBinary` in class `LongDataParameterHolder`
Parameters:
  `os` - database outputStream
Throws:
  `IOException` - if any error occur when reading reader

#### getMariaDbType

    public MariaDbType getMariaDbType()

Specified by:
  `getMariaDbType` in class `ParameterHolder`

#### toString

    public String toString()

Description copied from class: `ParameterHolder`
Nice formatting of prepared statements using PreparedStatement.toString().

Overrides:
  `toString` in class `ParameterHolder`
Returns:
  formatted value

#### isLongData

    public boolean isLongData()

Overrides:
  `isLongData` in class `LongDataParameterHolder`