Package com.caucho.vfs

Examples of com.caucho.vfs.TempStream


  private SelectResultSetImpl()
  {
    _ws = new WriteStream();
    _ws.setReuseBuffer(true);
    _ts = new TempStream();
    _rs = new ReadStream();
    _rs.setReuseBuffer(true);
    _buf = TempBuffer.allocate();
    _buffer = _buf.getBuffer();
    _cb = new CharBuffer();
View Full Code Here


   
    SSIResponse(HttpServletRequest request, HttpServletResponse response)
    {
      _request = request;
     
      _tempStream = new TempStream();
      _tempStream.openWrite();
      _out = new WriteStream(_tempStream);

      init(response);
    }
View Full Code Here

        flushBuffer();

        if (_chainingType == null)
          return;

        TempStream ts = _xsltStream.getTempStream();

        Document doc = null;
       
        ReadStream is = ts.openRead();
        Path userPath = Vfs.lookup();
        if (req instanceof CauchoRequest)
          userPath.setUserPath(((CauchoRequest) req).getPageURI());
        else
          userPath.setUserPath(req.getRequestURI());
View Full Code Here

    void setChaining()
    {
      if (_os != null)
        throw new IllegalStateException(L.l("setContentType for XSLT chaining must be before any data."));
     
      _tempStream = new TempStream();
      _tempStream.openWrite();

      _os = new WriteStream(_tempStream);
    }
View Full Code Here

    byte []tempBuffer = new byte[BLOCK_SIZE];

    getReadWrite().readBlock(BLOCK_SIZE, tempBuffer, 0, BLOCK_SIZE);

    TempStream ts = new TempStream();

    WriteStream os = new WriteStream(ts);

    try {
      for (int i = 0; i < ROOT_DATA_OFFSET; i++)
        os.write(tempBuffer[i]);

      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();
View Full Code Here

    }
  }
 
  protected TempStreamApi createTempStream()
  {
    return new TempStream();
  }
View Full Code Here

    return saveToString(env, this, true);
  }

  private StringValue saveToString(Env env, DOMNode node, boolean isHTML)
  {
    TempStream tempStream = new TempStream();

    try {
      tempStream.openWrite();
      WriteStream os = new WriteStream(tempStream);

      saveToStream(node, os, isHTML);

      os.close();
    }
    catch (IOException ex) {
      tempStream.discard();
      env.warning(ex);
      return null;
    }

    StringValue result = env.createBinaryString(tempStream.getHead());

    tempStream.discard();

    return result;
  }
View Full Code Here

    _image = ImageIO.read(_is);
   
    _width = _image.getWidth();
    _height = _image.getHeight();

    TempStream ts = new TempStream();
    WriteStream os = new WriteStream(ts);
   
    try {
      ImageIO.write(_image, "jpeg", os);
    } finally {
      os.close();
    }
   
    /*
    os = Vfs.openWrite("file:/tmp/caucho/qa/test.jpg");
    try {
      ImageIO.write(_image, "jpeg", os);
    } finally {
      os.close();
    }
   
    os = Vfs.openWrite("file:/tmp/caucho/qa/test.png");
    try {
      ImageIO.write(_image, "png", os);
    } finally {
      os.close();
    }
    */

    return parseImageJpeg(ts.openRead());
   
  }
View Full Code Here

      return false;
   
    if (is.read() != 0xd8)
      return false;

      TempStream ts = new TempStream();

      WriteStream ws = new WriteStream(ts);
      ws.write(0xff);
      ws.write(0xd8);
      is.writeToStream(ws);
      ws.close();

      // XXX: issues with _jpegHead vs ts.openReadAndSaveBuffer()
      _jpegHead = ts.getHead();
      is.close();

      _is = new ReadStream();
      ts.openRead(_is);

      parseJPEG();

      return true;
  }
View Full Code Here

  public boolean begin_document(@Optional String fileName,
                                @Optional String optList)
    throws IOException
  {
    _tempStream = new TempStream();
    _tempStream.openWrite();
    _os = new WriteStream(_tempStream);

    _out = new PDFWriter(_os);
    _out.beginDocument();
View Full Code Here

TOP

Related Classes of com.caucho.vfs.TempStream

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.