Package com.caucho.util

Examples of com.caucho.util.ByteBuffer


    // XXX: response.setIgnoreClientDisconnect(server.getIgnoreClientDisconnect());

    _dispatchRequest = new HmuxDispatchRequest(this);

    _uri = new ByteBuffer();

    _method = new CharBuffer();
    _host = new CharBuffer();
    _protocol = new CharBuffer();

    _headerKeys = new CharBuffer[HEADER_CAPACITY];
    _headerValues = new CharBuffer[_headerKeys.length];
    for (int i = 0; i < _headerKeys.length; i++) {
      _headerKeys[i] = new CharBuffer();
      _headerValues[i] = new CharBuffer();
    }

    _remoteHost = new CharBuffer();
    _remoteAddr = new CharBuffer();
    _serverName = new CharBuffer();
    _serverPort = new CharBuffer();
    _remotePort = new CharBuffer();

    _clientCert = new ByteBuffer();

    _cb1 = new CharBuffer();
    _cb2 = new CharBuffer();

    _filter = new ServletFilter();
View Full Code Here


   * Parses a list of statements from the ssi stream.
   */
  private void parse(ReadStream is, ArrayList<Statement> statements)
    throws IOException
  {
    ByteBuffer bb = new ByteBuffer();
    int ch;

    while ((ch = is.read()) >= 0) {
      if (ch != '<') {
        if (ch == '\n')
          _line++;

        bb.append(ch);
      }
      else if ((ch = is.read()) != '!') {
        bb.append('<');

        is.unread();
      }
      else if ((ch = is.read()) != '-') {
        bb.append('<');
        bb.append('!');

        is.unread();
      }
      else if ((ch = is.read()) != '-') {
        bb.append('<');
        bb.append('!');
        bb.append('-');

        is.unread();
      }
      else if ((ch = is.read()) != '#') {
        bb.append('<');
        bb.append('!');
        bb.append('-');
        bb.append('-');

        is.unread();
      }
      else {
        if (bb.getLength() > 0) {
          TextStatement text;

          text = new TextStatement(bb.getBuffer(), 0, bb.getLength());

          statements.add(text);
          bb.clear();
        }

        Statement stmt = parseCommand(is);

        statements.add(stmt);
       
        if (stmt instanceof IfStatement) {
          parseIf(is, (IfStatement) stmt);
        }
       
        if (stmt instanceof ElifStatement) {
          return;
        }
        else if (stmt instanceof ElseStatement) {
          return;
        }
        else if (stmt instanceof EndifStatement) {
          return;
        }
      }
    }

    if (bb.getLength() > 0) {
      statements.add(new TextStatement(bb.getBuffer(), 0, bb.getLength()));
      bb.clear();
    }
  }
View Full Code Here

                        null,
                        null);
        }
      }

      ByteBuffer buffer = new ByteBuffer();

      entry.load(buffer);

      bBuf = buffer.getBuffer();
      bLen = buffer.length();
     
      if (_classFileTransformerList != null) {
        Class<?> redefineClass = null;
        String className = name.replace('.', '/');
View Full Code Here

  private String _defaultEncoding;

  public MultipartStream()
    throws IOException
  {
    _boundary = new ByteBuffer();
  }
View Full Code Here

   * Parses a list of statements from the ssi stream.
   */
  private void parse(ReadStream is, ArrayList<Statement> statements)
    throws IOException
  {
    ByteBuffer bb = new ByteBuffer();
    int ch;

    while ((ch = is.read()) >= 0) {
      if (ch != '<') {
  if (ch == '\n')
    _line++;
   
  bb.append(ch);
      }
      else if ((ch = is.read()) != '!') {
  bb.append('<');

  is.unread();
      }
      else if ((ch = is.read()) != '-') {
  bb.append('<');
  bb.append('!');
 
  is.unread();
      }
      else if ((ch = is.read()) != '-') {
  bb.append('<');
  bb.append('!');
  bb.append('-');
 
  is.unread();
      }
      else if ((ch = is.read()) != '#') {
  bb.append('<');
  bb.append('!');
  bb.append('-');
  bb.append('-');
 
  is.unread();
      }
      else {
  if (bb.getLength() > 0) {
    TextStatement text;

    text = new TextStatement(bb.getBuffer(), 0, bb.getLength());
     
    statements.add(text);
    bb.clear();
  }

        Statement stmt = parseCommand(is);

        statements.add(stmt);
       
        if (stmt instanceof IfStatement) {
          parseIf(is, (IfStatement) stmt);
        }
       
        if (stmt instanceof ElifStatement) {
          return;
        }
        else if (stmt instanceof ElseStatement) {
          return;
        }
        else if (stmt instanceof EndifStatement) {
          return;
        }
      }
    }

    if (bb.getLength() > 0) {
      statements.add(new TextStatement(bb.getBuffer(), 0, bb.getLength()));
      bb.clear();
    }
  }
View Full Code Here

    // _server = Server.getCurrent();

    _dispatchRequest = new HmuxDispatchRequest(this);

    _uri = new ByteBuffer();

    _method = new CharBuffer();
    _host = new CharBuffer();
    _protocol = new CharBuffer();

    _headerKeys = new CharBuffer[HEADER_CAPACITY];
    _headerValues = new CharBuffer[_headerKeys.length];
    for (int i = 0; i < _headerKeys.length; i++) {
      _headerKeys[i] = new CharBuffer();
      _headerValues[i] = new CharBuffer();
    }

    _remoteHost = new CharBuffer();
    _remoteAddr = new CharBuffer();
    _serverName = new CharBuffer();
    _serverPort = new CharBuffer();
    _remotePort = new CharBuffer();

    _clientCert = new ByteBuffer();

    _cb1 = new CharBuffer();
    _cb2 = new CharBuffer();

    _filter = new ServletFilter();
View Full Code Here

  /**
   * Creates an uninitialized converter. Use <code>init</code> to initialize.
   */
  OldByteToChar()
  {
    bb = new ByteBuffer();
  }
View Full Code Here

  private String _defaultEncoding;

  public MultipartStream()
    throws IOException
  {
    _boundary = new ByteBuffer();
  }
View Full Code Here

      if (node == null || node.type != Node.DIR)
        throw new IOException(L.l("can't create file {0}", getFullPath()));

      Node child = node.lookup(tail);
      if (child == null)
        child = node.createFile(tail, new ByteBuffer(256));
      else if (! append) {
        node.remove(tail);
        child = node.createFile(tail, new ByteBuffer(256));
      }
      else if (child.type != child.FILE)
        throw new IOException(L.l("can't create file {0}", getFullPath()));
      return new MemoryStream(child, (ByteBuffer) child.data, true);
    }
View Full Code Here

  public void init(JavaClass javaClass, CodeAttribute codeAttr)
  {
    super.init(javaClass, codeAttr);

    _code = new ByteBuffer();
   
    byte []codeBuffer = codeAttr.getCode();
   
    _code.add(codeBuffer, 0, codeBuffer.length);
View Full Code Here

TOP

Related Classes of com.caucho.util.ByteBuffer

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.