Send directly to socket the sql data.

@param pos      output stream
@param sqlBytes the query in UTF-8 bytes
@throws IOException if connection error occur
181979
public static void sendMultiDirect(final PacketOutputStream pos, List<byte[]> sqlBytes)
      throws IOException {
    pos.startPacket(0);
    pos.write(Packet.COM_QUERY);
    for (byte[] bytes : sqlBytes) {
      pos.write(bytes);
    }
    pos.flush();
  }
395464
void writeBytes(byte[] bytes) throws IOException {
        int size = bytes.length;
        if (size < 256) {
            output.writeByte(BIN_8);
            output.writeByte(size);
        } else if (size < 65536) {
            output.writeByte(BIN_16);
            output.writeShort(size);
        } else {
            output.writeByte(BIN_32);
            output.writeInt(size);
        }
        output.write(bytes);
    }
147060
public static void writeInt(ByteBuffer buf, int pos, int v) {
    buf.put(pos++, (byte) (0xff & (v >> 24)));
    buf.put(pos++, (byte) (0xff & (v >> 16)));
    buf.put(pos++, (byte) (0xff & (v >> 8)));
    buf.put(pos, (byte) (0xff & v));
  }
505854
@Override
	public void write(DataOutputView out) throws IOException {
		out.writeInt(position);

		for (int i = 0; i < position; i++) {
			out.writeByte(data[i]);
		}
	}
412877
public void writeTo(final PacketOutputStream pos) throws IOException {
    if (loadedStream == null) {
      writeObjectToBytes();
    }
    pos.write(BINARY_INTRODUCER);
    pos.writeBytesEscaped(loadedStream, loadedStream.length, noBackSlashEscapes);
    pos.write(QUOTE);

  }
1010439
public void write(long pos, Buffer source, long byteCount) throws IOException {
    if (byteCount < 0 || byteCount > source.size()) throw new IndexOutOfBoundsException();

    while (byteCount > 0L) {
      long bytesWritten = fileChannel.transferFrom(source, pos, byteCount);
      pos += bytesWritten;
      byteCount -= bytesWritten;
    }
  }
857324
@Override
    public void writeTo(DataOutput out) throws IOException {
        out.writeByte(type);
        switch(type) {
            case DATA:
                Bits.writeLong(seqno, out);
                out.writeShort(conn_id);
                out.writeBoolean(first);
                break;
            case ACK:
                Bits.writeLong(seqno, out);
                out.writeShort(conn_id);
                Bits.writeInt(timestamp, out);
                break;
            case SEND_FIRST_SEQNO:
                Bits.writeInt(timestamp, out);
                break;
            case XMIT_REQ:
                break;
            case CLOSE:
                out.writeShort(conn_id);
                break;
        }
    }
587502
protected void assertPosition(long pos, long len) throws SQLException {
    checkFreed();
    if (pos < 1) {
      throw new PSQLException(GT.tr("LOB positioning offsets start at 1."),
          PSQLState.INVALID_PARAMETER_VALUE);
    }
    if (pos + len - 1 > Integer.MAX_VALUE) {
      throw new PSQLException(GT.tr("PostgreSQL LOBs can only index to: {0}", Integer.MAX_VALUE),
          PSQLState.INVALID_PARAMETER_VALUE);
    }
  }
897318
public void writeBinary(final PacketOutputStream pos) throws IOException {
    Calendar calendar = Calendar.getInstance(timeZone);
    calendar.setTimeInMillis(date.getTime());

    pos.write((byte) 7);//length
    pos.writeShort((short) calendar.get(Calendar.YEAR));
    pos.write((byte) ((calendar.get(Calendar.MONTH) + 1) & 0xff));
    pos.write((byte) (calendar.get(Calendar.DAY_OF_MONTH) & 0xff));
    pos.write((byte) 0);
    pos.write((byte) 0);
    pos.write((byte) 0);
  }
1238109
public void putByte(int pos, byte b) {
		adaptSize(pos + 1);
		ByteBuffer bb = getBuffer(pos);
		int i = pos % _bufferSize;
		bb.put(i, b);
	}
752602
public void writeTo(PacketOutputStream pos) throws IOException {
    pos.write(QUOTE);
    if (length == Long.MAX_VALUE) {
      pos.write(reader, true, noBackslashEscapes);
    } else {
      pos.write(reader, length, true, noBackslashEscapes);
    }
    pos.write(QUOTE);
  }
465464
protected void writeByteArray(ObjectOutput output, byte[] data) throws IOException {
        if (null == data || 0 == data.length) {
            output.writeInt(-1);
        } else {
            output.writeInt(data.length);
            output.write(data);
        }
    }
661494
public void writeBinary(final PacketOutputStream pos) throws IOException {
    Calendar calendar = Calendar.getInstance(timeZone);
    calendar.setTime(time);
    calendar.set(Calendar.DAY_OF_MONTH, 1);
    if (fractionalSeconds) {
      pos.write((byte) 12);
      pos.write((byte) 0);
      pos.writeInt(0);
      pos.write((byte) calendar.get(Calendar.HOUR_OF_DAY));
      pos.write((byte) calendar.get(Calendar.MINUTE));
      pos.write((byte) calendar.get(Calendar.SECOND));
      pos.writeInt(calendar.get(Calendar.MILLISECOND) * 1000);
    } else {
      pos.write((byte) 8);//length
      pos.write((byte) 0);
      pos.writeInt(0);
      pos.write((byte) calendar.get(Calendar.HOUR_OF_DAY));
      pos.write((byte) calendar.get(Calendar.MINUTE));
      pos.write((byte) calendar.get(Calendar.SECOND));
    }
  }
696092
@Override
    public void setBytes(int parameterIndex, byte[] x) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        this.parameters[parameterIndex-1] = x;
    }
1193094
public static byte[] toBytes(byte[] s) throws SQLException {
    if (s == null) {
      return null;
    }

    // Starting with PG 9.0, a new hex format is supported
    // that starts with "\x". Figure out which format we're
    // dealing with here.
    //
    if (s.length < 2 || s[0] != '\\' || s[1] != 'x') {
      return toBytesOctalEscaped(s);
    }
    return toBytesHexEscaped(s);
  }
1123396
public static void write(final String data, final OutputStream output) throws IOException {
		if (data != null) {
			output.write(data.getBytes(Charsets.UTF_8));
		}
	}
325945
public int setBytes(final long pos, byte[] bytes) throws SQLException {
        if (bytes == null) {
            throw new IllegalArgumentException("No byte to be set");
        } // end of if

        return setBytes(pos, bytes, 0, bytes.length);
    }