Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 16645 invoked from network); 2 Jan 2004 07:54:12 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 2 Jan 2004 07:54:12 -0000 Received: (qmail 16654 invoked by uid 500); 2 Jan 2004 07:53:44 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 16438 invoked by uid 500); 2 Jan 2004 07:53:43 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 16351 invoked from network); 2 Jan 2004 07:53:42 -0000 Received: from unknown (HELO umbongo.flamefew.net) (64.253.103.114) by daedalus.apache.org with SMTP; 2 Jan 2004 07:53:42 -0000 Received: by umbongo.flamefew.net (Postfix on Linux (i386), from userid 500) id EB4F71443; Fri, 2 Jan 2004 02:53:52 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by umbongo.flamefew.net (Postfix on Linux (i386)) with ESMTP id EA49E1437 for ; Fri, 2 Jan 2004 02:53:52 -0500 (EST) Date: Fri, 2 Jan 2004 02:53:52 -0500 (EST) From: Henri Yandell X-X-Sender: hen@umbongo.flamefew.net To: Jakarta Commons Developers List Subject: [io] EndianUtils.... Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I think the: public static long readSwappedLong( InputStream input ) throws IOException { int value1 = read( input ); int value2 = read( input ); int value3 = read( input ); int value4 = read( input ); int value5 = read( input ); int value6 = read( input ); int value7 = read( input ); int value8 = read( input ); return (long)( ( ( value1 & 0xff ) << 0 ) + ( ( value2 & 0xff ) << 8 ) + ( ( value3 & 0xff ) << 16 ) + ( ( value4 & 0xff ) << 24 ) + ( ( value5 & 0xff ) << 32 ) + ( ( value6 & 0xff ) << 40 ) + ( ( value7 & 0xff ) << 48 ) + ( ( value8 & 0xff ) << 56 ) ); } code is wrong as it doesn't look like the other readSwappedLong for a byte[]. I've rewritten it as: byte[] bytes = new byte[8]; input.read( bytes ); return readSwappedLong( bytes, 0 ); Just in case anyone with a clue has an opinion on the fix. Hen --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org