public boolean readNextHeaderBlock()
    throws IOException, TarMalformatException {

        // We read a-byte-at-a-time because there should only be 2 empty blocks
        // between each Tar Entry.
        try {
            while (readStream.available() > 0) {
                readBlock();

                if (readBuffer[0] != 0) {
                    return true;
                }
            }
        } catch (EOFException ee) {
            /* This is a work-around.
             * Sun Java's inputStream.available() works like crap.
             * Reach this point when performing a read of a GZip stream when
             * .available == 1, which according to API Spec, should not happen.
             * We treat this condition exactly as if readStream.available is 0,
             * which it should be.
             */
        }

        close();

        return false;
    }
public boolean readNextHeaderBlock ( ) throws IOException , TarMalformatException { try { while ( readStream . available ( ) > 0 ) { readBlock ( ) ; if ( readBuffer [ 0 ] != 0 ) { return true ; } } } catch ( EOFException ee ) { } close ( ) ; return false ; }
readBlock() and readNextHeaderBlock are the methods that USERS of this
class should use to read header blocks from the tar file.
<P>
readNextHeaderBlock continues working through the Tar File from the
current point until it finds a block with a non-0 first byte.

@return  True if a header block was read and place at beginning of the
readBuffer array.  False if EOF was encountered without finding
any blocks with first byte != 0.  If false is returned, we have
automatically closed the this TarFileInputStream too.
@see #readBlock