Index: TarArchiveInputStream.java
===================================================================
--- TarArchiveInputStream.java	(revision 1500555)
+++ TarArchiveInputStream.java	(working copy)
@@ -232,8 +232,9 @@
         }
 
         byte[] headerBuf = getRecord();
-
-        if (hasHitEOF) {
+        if (headerBuf == null)
+        {
+        	/* Hit EOF */
             currEntry = null;
             return null;
         }
@@ -331,21 +332,22 @@
      * @return The next header in the archive, or null.
      * @throws IOException on error
      */
-    private byte[] getRecord() throws IOException {
-        if (hasHitEOF) {
-            return null;
-        }
+    private byte[] getRecord() throws IOException
+    {
+		byte[] headerBuf = null;
 
-        byte[] headerBuf = buffer.readRecord();
+		if (!hasHitEOF)
+		{
+			headerBuf = buffer.readRecord();
+			hasHitEOF = buffer.isEOFRecord(headerBuf);
+			if (hasHitEOF && headerBuf != null)
+			{
+				buffer.tryToConsumeSecondEOFRecord();
+				headerBuf = null;
+			}
+		}
 
-        if (buffer.isEOFRecord(headerBuf)) {
-            hasHitEOF = true;
-            if (headerBuf != null) {
-                buffer.tryToConsumeSecondEOFRecord();
-            }
-        }
-
-        return hasHitEOF ? null : headerBuf;
+        return headerBuf;
     }
 
     private void paxHeaders() throws IOException{
