The

int read()

in TarInputStream

method should return values from 0..255
but indeed it returns values from -128..127.
To fix this, add 256, if value is negative.
Found this bug, because new GZIPInputStream(new TarInputStream(...))
will not recognize magic of GZIP.

Stephan

public int read()
       throws IOException
   {
       final int num = read( m_oneBuf, 0, 1 );
       if( num == -1 )
       {
           return num;
       }
       else
       {
           int b = (int)m_oneBuf[ 0 ];
           return b<0 ? b + 256 : b;
       }
   }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to