Package tkuri.uty

Examples of tkuri.uty.Bs


    while (aMsgData.state == MSG_CHUNK_SIZE
        || aMsgData.state == MSG_CHUNK_CRLF
        || aMsgData.state == MSG_CHUNK_TRAILER) {

      Bs line = _findNextLF(aMsgData);
      if (line == null) {
        break; // 次のバッファを待つ
      }
      aMsgData.rest += line.length();

      if (aMsgData.state == MSG_CHUNK_SIZE) {
        int size = (int) line.toLong(16);
        aMsgData.rest += size;
        aMsgData.state = (size == 0)
            ? MSG_CHUNK_TRAILER
            : MSG_CHUNK_CRLF;
View Full Code Here


      return null;
    }

    int len = lf + 1;

    Bs rv = aMsgData.reader.sub(0, len);
    aMsgData.rest += len;

    return rv;
  }
View Full Code Here

    head += len;
    head += aLine.match(head, IS_TABSP);

    len = aLine.match(head, IS_NOT_TABSP);
    Bs path = aLine.sub(head, len);

    head += len;
    head += aLine.match(head, IS_TABSP);

    aSelf.version = aLine.sub(head).trim();

    // http://host:port/path
    Bs host = Bs.BLANK;
    int port = 0;

    if (Const.S_CONNECT.equals(aSelf.method)) {
      int colon = path.indexOf(':');
      if (0 <= colon) {
        host = path.slice(0, colon);
        port = (int) path.sub(colon + 1).toLong();
      } else {
        host = path;
        port = 443;
      }
      path = Bs.BLANK;

    } else if (path.startsWith("http://")) {

      path = path.sub(7);

      int r = path.indexOf('/');
      if (r >= 0) {
        host = path.slice(0, r);
        path = path.sub(r);
      } else {
        host = path;
        path = Bs.valueOf("/");
      }

      int c = host.indexOf(':');
      if (c < 0) {
        port = 80;
      } else {
        port = (int) host.sub(c + 1).toLong();
        host = host.slice(0, c);
      }

    } else {
      host = Bs.valueOf("localhost");
      port = 80;
View Full Code Here

    while (state_ == MbhState.CHUNK_SIZE
        || state_ == MbhState.CHUNK_CRLF
        || state_ == MbhState.CHUNK_TRAILER) {

      Bs line = _findNextLF();
      if (line == null) {
        break; // 次のバッファを待つ
      }
      pointer_ += line.length();

      if (state_ == MbhState.CHUNK_SIZE) {
        int size = (int) line.toLong(16);
        pointer_ += size;
        _setState( (size == 0)
            ? MbhState.CHUNK_TRAILER
            : MbhState.CHUNK_CRLF);
View Full Code Here

      return null;
    }

    int len = lf + 1;

    Bs rv = reader_.sub(0, len);
    pointer_ += len;

    return rv;
  }
View Full Code Here

  /**
   * @param aLine
   */
  public void addLine(Bs aLine) {

    Bs value = _parse(aLine);

    list_.add(new HeaderPair(activeName_, value.trim()));
  }
View Full Code Here

TOP

Related Classes of tkuri.uty.Bs

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.