Examples of written()


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

    if(dictionarySize > MAX_DICTIONARY_SIZE) throw new TooBigDictionaryException();
    Decoder decoder = new Decoder();
    if(!decoder.SetDecoderProperties(props)) throw new InvalidCompressedDataException("Invalid properties");
    decoder.Code(is, cos, maxLength);
    //cos.flush();
    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()

        try {
            CountedOutputStream cos = new CountedOutputStream(new NullOutputStream());
            DataOutputStream dos = new DataOutputStream(cos);
            innerStoreStatus(dos);
            dos.close();
            statusLength = (int) cos.written() + parent.checker.checksumLength();
        } catch (IOException e) {
            throw new Error(e); // Impossible
        }
    }
View Full Code Here

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

        try {
            CountedOutputStream cos = new CountedOutputStream(new NullOutputStream());
            DataOutputStream dos = new DataOutputStream(cos);
            innerStoreStatus(dos);
            dos.close();
            int minStatusLength = (int) cos.written() + parent.checker.checksumLength();
            if(minStatusLength > statusLength)
                throw new StorageFormatException("Bad status length (too short)");
        } catch (IOException e) {
            throw new Error(e); // Impossible
        }
View Full Code Here

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

        int x = l == 0 ? -1 : is.read(buffer, 0, buffer.length);
        if(x <= -1) break;
        if(x == 0) throw new IOException("Returned zero from read()");
        bz2os.write(buffer, 0, x);
        read += x;
        if(cos.written() > maxWriteLength)
          throw new CompressionOutputSizeException();
      }
      bz2os.flush();
      cos.flush();
      bz2os.close();
View Full Code Here

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

      }
      bz2os.flush();
      cos.flush();
      bz2os.close();
      bz2os = null;
      if(cos.written() > maxWriteLength)
        throw new CompressionOutputSizeException();
      return cos.written();
    } finally {
      if(bz2os != null) {
        bz2os.flush();
View Full Code Here

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

      cos.flush();
      bz2os.close();
      bz2os = null;
      if(cos.written() > maxWriteLength)
        throw new CompressionOutputSizeException();
      return cos.written();
    } finally {
      if(bz2os != null) {
        bz2os.flush();
        bz2os.close();
      }
View Full Code Here

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

        int x = l == 0 ? -1 : is.read(buffer, 0, l);
        if(x <= -1) break;
        if(x == 0) throw new IOException("Returned zero from read()");
        gos.write(buffer, 0, x);
        read += x;
        if(cos.written() > maxWriteLength)
          throw new CompressionOutputSizeException();
      }
      gos.flush();
      gos.finish();
      cos.flush();
View Full Code Here

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

      }
      gos.flush();
      gos.finish();
      cos.flush();
      gos = null;
      if(cos.written() > maxWriteLength)
        throw new CompressionOutputSizeException();
      return cos.written();
    } finally {
      if(gos != null) {
        gos.flush();
View Full Code Here

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

      gos.finish();
      cos.flush();
      gos = null;
      if(cos.written() > maxWriteLength)
        throw new CompressionOutputSizeException();
      return cos.written();
    } finally {
      if(gos != null) {
        gos.flush();
        gos.finish();
      }
View Full Code Here

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

        try {
            CountedOutputStream cos = new CountedOutputStream(new NullOutputStream());
            DataOutputStream dos = new DataOutputStream(cos);
            innerStoreStatus(dos);
            dos.close();
            statusLength = (int) cos.written() + parent.checker.checksumLength();
        } catch (IOException e) {
            throw new Error(e); // Impossible
        }
    }
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.