/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.commons.compress.compressors.brotli;

import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.compress.compressors.CompressorInputStream;

/**
 * {@link FilterInputStream} implementation to decode Brotli encoded stream.
 * Library relies on <a href="https://github.com/google/brotli">Google brotli</a>
 * 
 * @since 1.14
 */
public class BrotliCompressorInputStream extends CompressorInputStream {
    
    private org.brotli.dec.BrotliInputStream decIS;

    public BrotliCompressorInputStream(InputStream in) throws IOException {
        this.decIS = new org.brotli.dec.BrotliInputStream(in);
    }

    /**
     * @return
     * @throws IOException
     * @see java.io.InputStream#available()
     */
    public int available() throws IOException {
        return decIS.available();
    }

    /**
     * @throws IOException
     * @see org.brotli.dec.BrotliInputStream#close()
     */
    public void close() throws IOException {
        decIS.close();
    }

    /**
     * @return
     * @see java.lang.Object#hashCode()
     */
    public int hashCode() {
        return decIS.hashCode();
    }

    /** {@inheritDoc} */
    @Override
    public int read(byte[] b) throws IOException {
        return decIS.read(b);
    }

    /**
     * @param obj
     * @return
     * @see java.lang.Object#equals(java.lang.Object)
     */
    public boolean equals(Object obj) {
        return decIS.equals(obj);
    }

    /**
     * @param n
     * @return
     * @throws IOException
     * @see java.io.InputStream#skip(long)
     */
    public long skip(long n) throws IOException {
        return decIS.skip(n);
    }

    /**
     * @param readlimit
     * @see java.io.InputStream#mark(int)
     */
    public void mark(int readlimit) {
        decIS.mark(readlimit);
    }

    /**
     * @return
     * @see java.io.InputStream#markSupported()
     */
    public boolean markSupported() {
        return decIS.markSupported();
    }

    /** {@inheritDoc} */
    @Override
    public int read() throws IOException {
        final int ret = decIS.read();
        count(ret == -1 ? 0 : 1);
        return ret;
    }

    /** {@inheritDoc} */
    @Override
    public int read(byte[] buf, int off, int len) throws IOException {
        final int ret = decIS.read(buf, off, len);
        count(ret);
        return ret;
    }

    /**
     * @return
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return decIS.toString();
    }

    /**
     * @throws IOException
     * @see java.io.InputStream#reset()
     */
    public void reset() throws IOException {
        decIS.reset();
    }
    

    /**
     * There is no magic for Brotli
     * 
     * @param signature
     *            the bytes to check
     * @param length
     *            the number of bytes to check
     * @return true
     */
    static boolean matches(final byte[] signature, final int length) {
        return true;
    }
}

@@ -1573,32 +1573,46 @@
 lable()%0A     */%0A
+    @Override%0A
     public int a
@@ -1635,32 +1635,32 @@
 s IOException %7B%0A
-
         return d
@@ -1772,32 +1772,46 @@
 close()%0A     */%0A
+    @Override%0A
     public void 
@@ -1932,32 +1932,46 @@
 hCode()%0A     */%0A
+    @Override%0A
     public int h
@@ -2244,32 +2244,46 @@
 Object)%0A     */%0A
+    @Override%0A
     public boole
@@ -2456,32 +2456,46 @@
 p(long)%0A     */%0A
+    @Override%0A
     public long 
@@ -2639,32 +2639,46 @@
 rk(int)%0A     */%0A
+    @Override%0A
     public void 
@@ -2808,32 +2808,46 @@
 orted()%0A     */%0A
+    @Override%0A
     public boole
@@ -3364,32 +3364,46 @@
 tring()%0A     */%0A
+    @Override%0A
     public Strin
@@ -3532,24 +3532,24 @@
 reset()%0A
-
      */%0A
     publ
@@ -3536,24 +3536,38 @@
 t()%0A     */%0A
+    @Override%0A
     public v

Add Brotli decoder based on the Google Brotli library. Add missing '@Override' annotations