/*
 * 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.archivers;

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

/**
 * Archive input streams are expected to override the<br/>
 * {@link #read()} and {@link #read(byte[] b, int off, int len)} <br/>
 * methods so that reading from the stream generates EOF for the end of
 * data in each entry as well as at the end of the file proper. The
 * {@link #getNextEntry()} method is used to reset the input stream
 * ready for reading the data from the next entry.
 * <p>
 * The input stream classes must also implement a method with the signature:
 * <pre>
 * public static boolean matches(byte[] signature, int length)
 * </pre>
 * which is used by the {@link ArchiveStreamFactory} to autodetect
 * the archive type from the first few bytes of a stream. 
 */
public abstract class ArchiveInputStream extends InputStream {

    /**
     * Returns the next Archive Entry in this Stream.
     * @return the next entry
     * @throws IOException if the next entry could not be read
     */
    public abstract ArchiveEntry getNextEntry() throws IOException;

}

@@ -937,23 +937,19 @@
 ams 
-are expected to
+%3Cb%3EMUST%3C/b%3E
  ove
@@ -961,36 +961,12 @@
  the
-%3Cbr/%3E
+ 
 %0A *
- %7B@link #read()%7D and
  %7B@l
@@ -985,36 +985,43 @@
 te%5B%5D
- b
 , int
- off
 , int
- len)%7D %3Cbr/%3E
+)%7D - or %7B@link #read()%7D -
 %0A * 
@@ -1026,17 +1026,16 @@
 * method
-s
  so that
@@ -1155,15 +1155,22 @@
 per.
+%0A * %3Cp%3E%0A *
  The
-%0A *
  %7B@l
@@ -1642,16 +1642,105 @@
 ream %7B%0A%0A
+    private byte%5B%5D SINGLE = new byte%5B1%5D;%0A    private static final int BYTE_MASK = 0xFF;%0A%0A
     /**%0A
@@ -1963,10 +1963,970 @@
 ption;%0A%0A
+    /*%0A     * Note that subclasses also implement specific get() methods which%0A     * return the appropriate class without need for a cast.%0A     * See SVN revision r743259%0A     * @return%0A     * @throws IOException%0A     */%0A    // public abstract XXXArchiveEntry getNextXXXEntry() throws IOException;%0A%0A%0A    /**%0A     * Reads a byte of data. This method will block until enough input is%0A     * available.%0A     * %0A     * Simply calls the %7B@link #read(byte%5B%5D, int, int)%7D method.%0A     * %0A     * MUST be overridden if the %7B@link #read(byte%5B%5D, int, int)%7D method%0A     * is not overridden; may be overridden otherwise.%0A     * %0A     * @return the byte read, or -1 if end of input is reached%0A     * @throws IOException%0A     *             if an I/O error has occurred or if a CPIO file error has%0A     *             occurred%0A     */%0A    public int read() throws IOException %7B%0A        int num = read(SINGLE, 0, 1);%0A        return num == -1 ? -1 : SINGLE%5B0%5D & BYTE_MASK;%0A    %7D%0A
 %7D%0A

Implement generic read() Update Javadoc