Package com.caucho.vfs

Examples of com.caucho.vfs.WriteStream


        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


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

    if (_path.exists()) {
      throw new SQLException(L.l("CREATE for path '{0}' failed, because the file already exists.  CREATE can not override an existing table.",
                                 _path.getNativePath()));
    }
   
    WriteStream os = _path.openWrite();
    os.close();
  }
View Full Code Here

      return;
    }

    Path path = Vfs.lookup(args[0]);

    WriteStream out = Vfs.openWrite(System.out);
   
    new DebugStore(path).test(out);

    out.close();
  }
View Full Code Here

    if (args.length != 2) {
      System.out.println("usage: DebugQuery db-directory query");
      return;
    }

    WriteStream out = Vfs.openWrite(System.out);

    out.close();
  }
View Full Code Here

        } catch (IOException e) {
        }
        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;

          while ((len = is.read(buf, 0, buf.length)) > 0) {
            os.write(buf, 0, len);
            totalLength += len;
          }
        } finally {
          os.close();

          TempBuffer.free(tempBuffer);
          tempBuffer = null;
        }
View Full Code Here

    _children.put(address, child);
  }

  private Env createEnv(QuercusPage page, String type, String address)
  {
    WriteStream out = new NullWriteStream();

    Env env = new Env(_quercus, page, out, null, null);
    env.start();

    JavaClassDef actorClassDef =
View Full Code Here

  }

  private Env createEnv(QuercusPage page, BamEventType type,
                        String to, String from, Serializable value)
  {
    WriteStream out = new NullWriteStream();

    Env env = new Env(_quercus, page, out, null, null);

    JavaClassDef actorClassDef = env.getJavaClassDefinition(BamPhpActor.class);
    env.setGlobalValue("_quercus_bam_actor", actorClassDef.wrap(env, this));
View Full Code Here

  private void writeRootHash(String hash)
    throws IOException
  {
    Path path = _rootDirectory.lookup(APPLICATION_HASH_PATH);
   
    WriteStream os = null;
   
    try {
      path.getParent().mkdirs();
     
      os = path.openWrite();
     
      os.println(hash);
    } finally {
      IoUtil.close(os);
    }
  }
View Full Code Here

                  HttpServletRequest request,
                  HttpServletResponse response,
                  ServletContext application)
    throws IOException
  {
    WriteStream logStream = getLogStream();

    if (logStream == null)
      return;

    CharBuffer cb = CharBuffer.allocate();

    QDate.formatLocal(cb, Alarm.getCurrentTime(), "[%Y/%m/%d %H:%M:%S] ");

    cb.append(message);

    logStream.log(cb.close());

    logStream.flush();
  }
View Full Code Here

TOP

Related Classes of com.caucho.vfs.WriteStream

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.