public void processData(byte[] data, int len, long recTime) {

    if (!inQuery) {
      if (!inTrax) {
        traxStart = recTime;
        txId = sharedData.txId.incrementAndGet();

        if ((autoCommit && tempAutoCommit) || traxEnd(data, len)) {
          endingTrax = true;
        } else {
          inTrax = true;
        }

      } else {
        if (traxEnd(data, len)) {
          inTrax = false;
          endingTrax = true;
        }
      }

      queryStart = recTime;

      if (len - 5 + 1 > bufferSize)
        bufferSize *= 2;

      queryBuffer = ByteBuffer.allocate(bufferSize);
      queryBuffer.put((byte) ',');
      queryBuffer.put(data, 5, len - 5);

      inQuery = true;

    } else {
      while (len > queryBuffer.remaining()) {
        ByteBuffer tmp = queryBuffer;
        bufferSize *= 2;
        queryBuffer = ByteBuffer.allocate(bufferSize);
        tmp.limit(tmp.position());
        tmp.position(0);
        queryBuffer.put(tmp);
      }
      queryBuffer.put(data, 0, len);
    }
  }