[Kaffe] a new patch for ZipOutputStream

Moses DeJong dejong at cs.umn.edu
Tue Feb 23 23:49:26 PST 1999


On Tue, 23 Feb 1999, Archie Cobbs wrote:

> Moses DeJong writes:
> >  private void put16(byte[] zheader, int pos, int val) {
> >  	zheader[pos] = (byte)val;
> > -	zheader[pos+1] = (byte)(val >> 8);
> > +	zheader[pos+1] = (byte)(val >>> 8);
> >  }
> 
> This patch was just committed, but just FYI it's not necessary because
> you're already masking off the top 24 bits with the (byte) cast.
> 
> -Archie
> 
> ___________________________________________________________________________
> Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


You are correct, the implementation of put16() does not create an error
by using >> instead of >>> but the put32 function will. I though it
would just be a lot more clear if they both did it the same way
even if the put16() did not really "need" it.

Mo 



More information about the kaffe mailing list