Exemple #1
0
  /*
  * Fills the input buffer with data to be decompressed.
  *
  * @throws IOException
  *             if an {@code IOException} occurs.
  */
 protected void fill(){// throws IOException {
     if (closed) {
         throw new java.io.IOException("Stream is closed"); //$NON-NLS-1$
     }
     if ((len = inJ.read(buf)) > 0) {
         inf.setInput(buf, 0, len);
     }
 }
Exemple #2
0
        /*
         * Writes a bit to the uncompressing output stream.
         *
         * @param b
         *            the byte array to write to the uncompressing output stream.
         * @param off
         *            the offset in the byte array where the data is first to be
         *            uncompressed.
         * @param len
         *            the number of the bytes to be uncompressed.
         * @throws IOException
         *             if the stream has been closed or some I/O error occurs.
         * @throws ZipException
         *             if a zip exception occurs.
         * @throws NullPointerException
         *             if the byte array is null.
         * @throws IndexOutOfBoundsException
         *             if the off less than zero or len less than zero or off + len
         *             is greater than the byte array length.
         */

        public override void write(byte[] b, int off, int len) //throws IOException,
        {                                                      //ZipException {
            checkClosed();
            if (null == b)
            {
                throw new java.lang.NullPointerException();
            }
            if (off < 0 || len < 0 || len > b.Length - off)
            {
                throw new java.lang.IndexOutOfBoundsException();
            }

            inf.setInput(b, off, len);
            write();
        }