Package com.caucho.vfs

Examples of com.caucho.vfs.TempBuffer


    int rOffset = rLength % SIZE;
    int rBlockId = rLength / SIZE;

    if (_buffers[rBlockId] == null) {
      TempBuffer tempBuffer = TempBuffer.allocate();
      _tempBuffers[rBlockId] = tempBuffer;
      _buffers[rBlockId] = tempBuffer.getBuffer();
    }

    byte []rBuffer = _buffers[rBlockId];
    rBuffer[rOffset] = (byte) ColumnType.VARCHAR.ordinal();
View Full Code Here


    }

    byte []buffer = _buffers[blockId];

    if (buffer == null) {
      TempBuffer tempBuffer = TempBuffer.allocate();
      _tempBuffers[blockId] = tempBuffer;
      _buffers[blockId] = tempBuffer.getBuffer();

      buffer = _buffers[blockId];
    }

    buffer[rOffset] = (byte) value;
View Full Code Here

      int rOffset = rLength % SIZE;

      int rBufferId = rLength / SIZE;

      if (rOffset == 0) {
        TempBuffer tempBuffer = TempBuffer.allocate();
        if (_tempBuffers.length <= rBufferId) {
          int len = _tempBuffers.length;

          TempBuffer []newTempBuffers = new TempBuffer[len + 32];
          System.arraycopy(_tempBuffers, 0, newTempBuffers, 0, len);
          _tempBuffers = newTempBuffers;

          byte [][]newBuffers = new byte[len + 32][];
          System.arraycopy(_buffers, 0, newBuffers, 0, len);
          _buffers = newBuffers;

        }

        _tempBuffers[rBufferId] = tempBuffer;
        _buffers[rBufferId] = tempBuffer.getBuffer();
      }

      byte []rBuffer = _buffers[rBufferId];

      int sublen = rBuffer.length - rOffset;
View Full Code Here

  }

  public void close()
  {
    for (int i = 0; i < _buffers.length; i++) {
      TempBuffer buffer = _tempBuffers[i];

      if (buffer != null)
        TempBuffer.free(buffer);

      _tempBuffers[i] = null;
View Full Code Here

      ws.write(0);

    setEnvironment(stream, ws, req);

    InputStream in = req.getInputStream();
    TempBuffer tempBuf = TempBuffer.allocate();
    byte []buf = tempBuf.getBuffer();
    int len = buf.length;
    int sublen;

    writeHeader(ws, FCGI_PARAMS, 0);

    boolean hasStdin = false;
    while ((sublen = in.read(buf, 0, len)) > 0) {
      hasStdin = true;
      writeHeader(ws, FCGI_STDIN, sublen);
      ws.write(buf, 0, sublen);
    }

    TempBuffer.free(tempBuf);
    tempBuf = null;

    /*
    if (hasStdin)
      writeHeader(fcgiSocket, ws, FCGI_STDIN, 0);
    */
    writeHeader(ws, FCGI_STDIN, 0);
   
    ws.flush();

    FastCGIInputStream is = new FastCGIInputStream(stream);

    int ch = parseHeaders(res, is);

    if (ch >= 0)
      out.write(ch);

    TempBuffer tb = TempBuffer.allocate();
    byte []buffer = tb.getBuffer();

    while ((sublen = is.read(buffer, 0, buffer.length)) > 0) {
      out.write(buffer, 0, sublen);
    }

View Full Code Here

      int contentLength = req.getContentLength();

      InputStream is = req.getInputStream();

      TempBuffer tempBuffer = TempBuffer.allocate();
      byte []buffer = tempBuffer.getBuffer();

      boolean isFirst = true;

      if (contentLength >= 0) {
        isFirst = false;
View Full Code Here

      timeout = new TimeoutAlarm(requestURI, process, inputStream);
      alarm = new Alarm(timeout, 360 * 1000);

      OutputStream outputStream = process.getOutputStream();

      TempBuffer tempBuf = TempBuffer.allocate();
      byte []buf = tempBuf.getBuffer();
     
      try {
        ServletInputStream sis = req.getInputStream();
        int len;

View Full Code Here

      if (inode != null)
        inode.closeOutputStream();

      _inodeBuffer = null;

      TempBuffer tempBuffer = _tempBuffer;
      _tempBuffer = null;

      if (tempBuffer != null) {
        TempBuffer.freeLarge(tempBuffer);
      }
View Full Code Here

      writeTableHeader(os);
    } finally {
      os.close();
    }

    TempBuffer head = ts.getHead();
    int offset = 0;
    for (; head != null; head = head.getNext()) {
      byte []buffer = head.getBuffer();

      int length = head.getLength();

      System.arraycopy(buffer, 0, tempBuffer, offset, length);

      for (; length < buffer.length; length++) {
        tempBuffer[offset + length] = 0;
View Full Code Here

        Path tempFile = tempDir.createTempFile("form", ".tmp");
        request.addCloseOnExit(tempFile);

        WriteStream os = tempFile.openWrite();

        TempBuffer tempBuffer = TempBuffer.allocate();
        byte []buf = tempBuffer.getBuffer();

        int totalLength = 0;

        try {
          int len;
View Full Code Here

TOP

Related Classes of com.caucho.vfs.TempBuffer

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.