Package com.caucho.vfs

Examples of com.caucho.vfs.TempBuffer


   * Append from an input stream, reading from the input stream until
   * end of file or the length is reached.
   */
  public int appendReadAll(ReadStream is, long length)
  {
    TempBuffer tBuf = TempBuffer.allocate();

    try {
      byte []buffer = tBuf.getBuffer();
      int readLength = 0;

      while (length > 0) {
        int sublen = buffer.length;
        if (length < sublen)
View Full Code Here


   * Append from an input stream, using InputStream semantics, i.e
   * call is.read() only once.
   */
  public int appendRead(BinaryInput is, long length)
  {
    TempBuffer tBuf = TempBuffer.allocate();

    try {
      byte []buffer = tBuf.getBuffer();
      int sublen = buffer.length;
      if (length < sublen)
        sublen = (int) length;
      else if (length > sublen) {
        buffer = new byte[(int) length];
View Full Code Here

   * Append from an input stream, reading all available data from the
   * stream.
   */
  public int appendReadAll(BinaryInput is, long length)
  {
    TempBuffer tBuf = TempBuffer.allocate();

    try {
      byte []buffer = tBuf.getBuffer();
      int readLength = 0;

      while (length > 0) {
        int sublen = buffer.length;
        if (length < sublen)
View Full Code Here

 
  is = path.openRead();

  OutputStream out = inode.openOutputStream();

  TempBuffer tempBuffer = TempBuffer.allocate();
  byte []buffer = tempBuffer.getBuffer();
 
  int readLength = 0;
  int len;

  log.info("ModuleRepository[] loading " + urlString);
View Full Code Here

 
  is = conn.getInputStream();

  OutputStream out = inode.openOutputStream();

  TempBuffer tempBuffer = TempBuffer.allocate();
  byte []buffer = tempBuffer.getBuffer();
 
  int readLength = 0;
  int len;

  log.info("ModuleRepository[] loading " + urlString);
View Full Code Here

   
    ws.close();
   
    out.writeInt(ts.getLength());
   
    TempBuffer ptr = ts.getHead();

    for (; ptr != null; ptr = ptr.getNext())
      out.write(ptr.getBuffer(), 0, ptr.getLength());

    ts.destroy();
  }
View Full Code Here

      return;

    MessageDigest digest = MessageDigest.getInstance(algorithm);

    InputStream is = source.openInputStream();
    TempBuffer tempBuffer = TempBuffer.allocate();
    try {
      byte []buffer = tempBuffer.getBuffer();

      int len;

      while ((len = is.read(buffer, 0, buffer.length)) > 0) {
  digest.update(buffer, 0, len);
View Full Code Here

    }
   
    void writeData(Env env, OutputStream os)
      throws IOException
    {
      TempBuffer tempBuf = null;
     
      try {
       tempBuf = TempBuffer.allocate();
        byte []buf = tempBuf.getBuffer();
     
        ReadStream is = _path.openRead();
       
        int len;
        while ((len = is.read(buf, 0, buf.length)) > 0) {
View Full Code Here

   * Append from an input stream, using InputStream.read semantics,
   * i.e. just call is.read once even if more data is available.
   */
  public int appendRead(InputStream is, long length)
  {
    TempBuffer tBuf = TempBuffer.allocate();

    try {
      byte []buffer = tBuf.getBuffer();
      int sublen = buffer.length;
      if (length < sublen)
        sublen = (int) length;

      sublen = is.read(buffer, 0, sublen);
View Full Code Here

   * Append from an input stream, reading from the input stream until
   * end of file or the length is reached.
   */
  public int appendReadAll(InputStream is, long length)
  {
    TempBuffer tBuf = TempBuffer.allocate();

    try {
      byte []buffer = tBuf.getBuffer();
      int readLength = 0;
     
      while (length > 0) {
        int sublen = buffer.length;
        if (length < sublen)
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.