class RpcStreamConnection extends RpcConnection {

    void reallocateSendBufferInPutPacketIfRunOut(@Nonnull final RpcPacketSupplier supplier,
            @Nonnull final byte[] fieldBytes, final int reallocateIncrement) {
        byte[] sendBytes = supplier.sendBytes();
        int sendPos = supplier.sendPos();

        byte[] newSendBytes = sendBytes;
        if ((sendBytes.length - sendPos) <= fieldBytes.length) {
            stats.bufferCompacts.getAndIncrement(); // We're overloading the
                                                    // meaning here...
            int newBytesLength = sendBytes.length + fieldBytes.length + reallocateIncrement;
            newSendBytes = new byte[newBytesLength];
            System.arraycopy(sendBytes, 0, newSendBytes, 0, sendPos);
        }

        System.arraycopy(fieldBytes, 0, newSendBytes, sendPos, fieldBytes.length);
        supplier.sendBytes(newSendBytes).sendPos(sendPos + fieldBytes.length);
    }

    public  RpcStreamConnection(String serverHost, int serverPort, Properties props,
                               ServerStats stats, P4Charset p4Charset, boolean secure);
    private  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, P4Charset p4Charset, Socket socket, boolean secure);
    private  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, P4Charset p4Charset, Socket socket, RpcSocketPool pool, boolean secure);
    public  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, P4Charset p4Charset, Socket socket, RpcSocketPool pool, boolean secure,
            String rsh);

}