Examples of written()


Examples of freenet.support.io.CountedOutputStream.written()

    private int getStoredLength(FailureCodeTracker f) throws IOException {
        CountedOutputStream os = new CountedOutputStream(new NullOutputStream());
        DataOutputStream dos = new DataOutputStream(os);
        f.writeFixedLengthTo(dos);
        dos.close();
        return (int) os.written();
    }

}
View Full Code Here

Examples of freenet.support.io.CountedOutputStream.written()

        try {
            writeTo(new DataOutputStream(cos));
        } catch (IOException e) {
            throw new Error("Could not write to CountedOutputStream: "+e, e);
        }
        return cos.written();
    }

  /**
   * Read a key using the current settings.
   * @throws IOException
View Full Code Here

Examples of freenet.support.io.CountedOutputStream.written()

        encoder.SetDictionarySize( 1 << 20 );
        // enc.WriteCoderProperties( out );
        // 5d 00 00 10 00
        encoder.Code( cis, cos, -1, -1, null );
    if(logMINOR)
      Logger.minor(this, "Read "+cis.count()+" written "+cos.written());
    if(cos.written() > maxWriteLength)
      throw new CompressionOutputSizeException();
    cos.flush();
    return cos.written();
  }
View Full Code Here

Examples of freenet.support.io.CountedOutputStream.written()

        // enc.WriteCoderProperties( out );
        // 5d 00 00 10 00
        encoder.Code( cis, cos, -1, -1, null );
    if(logMINOR)
      Logger.minor(this, "Read "+cis.count()+" written "+cos.written());
    if(cos.written() > maxWriteLength)
      throw new CompressionOutputSizeException();
    cos.flush();
    return cos.written();
  }
View Full Code Here

Examples of freenet.support.io.CountedOutputStream.written()

    if(logMINOR)
      Logger.minor(this, "Read "+cis.count()+" written "+cos.written());
    if(cos.written() > maxWriteLength)
      throw new CompressionOutputSizeException();
    cos.flush();
    return cos.written();
  }

  public Bucket decompress(Bucket data, BucketFactory bf, long maxLength, long maxCheckSizeLength, Bucket preferred) throws IOException, CompressionOutputSizeException {
    Bucket output;
    if(preferred != null)
View Full Code Here

Examples of freenet.support.io.CountedOutputStream.written()

  public long decompress(InputStream is, OutputStream os, long maxLength, long maxCheckSizeBytes) throws IOException, CompressionOutputSizeException {
    CountedOutputStream cos = new CountedOutputStream(os);
    Decoder decoder = new Decoder();
    decoder.SetDecoderProperties(props);
    decoder.Code(is, cos, maxLength);
    return cos.written();
  }

  @Override
  public int decompress(byte[] dbuf, int i, int j, byte[] output) throws CompressionOutputSizeException {
    // Didn't work with Inflater.
View Full Code Here

Examples of freenet.support.io.CountedOutputStream.written()

            dictionarySize <<= 1;
        }
        encoder.SetDictionarySize( dictionarySize );
        encoder.WriteCoderProperties(os);
        encoder.Code( cis, cos, maxReadLength, maxWriteLength, null );
    if(cos.written() > maxWriteLength)
      throw new CompressionOutputSizeException(cos.written());
        cos.flush();
    if(logMINOR)
      Logger.minor(this, "Read "+cis.count()+" written "+cos.written());
    return cos.written();
View Full Code Here

Examples of freenet.support.io.CountedOutputStream.written()

        }
        encoder.SetDictionarySize( dictionarySize );
        encoder.WriteCoderProperties(os);
        encoder.Code( cis, cos, maxReadLength, maxWriteLength, null );
    if(cos.written() > maxWriteLength)
      throw new CompressionOutputSizeException(cos.written());
        cos.flush();
    if(logMINOR)
      Logger.minor(this, "Read "+cis.count()+" written "+cos.written());
    return cos.written();
  }
View Full Code Here

Examples of freenet.support.io.CountedOutputStream.written()

        encoder.Code( cis, cos, maxReadLength, maxWriteLength, null );
    if(cos.written() > maxWriteLength)
      throw new CompressionOutputSizeException(cos.written());
        cos.flush();
    if(logMINOR)
      Logger.minor(this, "Read "+cis.count()+" written "+cos.written());
    return cos.written();
  }

  public Bucket decompress(Bucket data, BucketFactory bf, long maxLength, long maxCheckSizeLength, Bucket preferred) throws IOException, CompressionOutputSizeException {
    Bucket output;
View Full Code Here

Examples of freenet.support.io.CountedOutputStream.written()

    if(cos.written() > maxWriteLength)
      throw new CompressionOutputSizeException(cos.written());
        cos.flush();
    if(logMINOR)
      Logger.minor(this, "Read "+cis.count()+" written "+cos.written());
    return cos.written();
  }

  public Bucket decompress(Bucket data, BucketFactory bf, long maxLength, long maxCheckSizeLength, Bucket preferred) throws IOException, CompressionOutputSizeException {
    Bucket output;
    if(preferred != null)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.