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

## Class ReaderParameter

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

All Implemented Interfaces:
  ParameterHolder

    public class ReaderParameter
    extends LongDataParameter

### 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()`
`void` `sendComLongData(int statementId, short parameterId, PacketOutputStream writer)` Send reader in one or many COM_STMT_LONG_DATA.
`String` `toString()`
`void` `writeTo(PacketOutputStream os)` Write reader to database in text format.
`void` `writeUnsafeTo(PacketOutputStream os)` Write reader to database in text format without checking buffer size.

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

`isLongData, isNullData`

### 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(PacketOutputStream os)
                 throws IOException

Write reader to database in text format.

Parameters:
  `os` - database outputStream
Throws:
  `IOException` - if any error occur when reading reader

#### writeUnsafeTo

    public void writeUnsafeTo(PacketOutputStream os)
                       throws IOException

Write reader to database in text format without checking buffer size.

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

Returns:
  approximated data length.
Throws:
  `IOException` - if error reading stream

#### sendComLongData

    public void sendComLongData(int statementId,
                                short parameterId,
                                PacketOutputStream writer)
                         throws IOException,
                                QueryException

Send reader in one or many COM_STMT_LONG_DATA. (reading is using a big buffer to avoid having a lot of packet, because server will allocate/deallocate array each send)

Specified by:
  `sendComLongData` in class `LongDataParameter`
Parameters:
  `statementId` - statement id
  `parameterId` - parameter number
  `writer` - writer
Throws:
  `IOException` - if any connection exception occur
  `QueryException` - if query size is to big according to server max_allowed_size

#### getMariaDbType

    public MariaDbType getMariaDbType()

#### toString

    public String toString()

Specified by:
  `toString` in interface `ParameterHolder`
Overrides:
  `toString` in class `Object`