applyToBuffer method

  1. @override
void applyToBuffer(
  1. ByteDataWriter buffer
)
override

Implementation

@override
void applyToBuffer(ByteDataWriter buffer) {
  buffer.writeUint8(ClientMessage.ParseIdentifier);
  final length = 8 +
      _statement.byteLength +
      _statementName.byteLength +
      _types.length * 4;
  buffer.writeUint32(length);
  // Name of prepared statement
  _statementName.applyToBuffer(buffer);
  _statement.applyToBuffer(buffer); // Query string

  // Parameters and their types
  buffer.writeUint16(_types.length);
  for (final type in _types) {
    buffer.writeInt32(type?.oid ?? 0);
  }
}