X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id CFCD39FB326 for ; Mon, 10 Jul 2006 15:59:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 55504-03 for ; Mon, 10 Jul 2006 15:59:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) by postgresql.org (Postfix) with ESMTP id CF2D69FB2F0 for ; Mon, 10 Jul 2006 15:59:43 -0300 (ADT) Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP with MS-WebStorage 6.0.6249 Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; 10 Jul 2006 11:59:42 -0700 Subject: Re: java & endianness [Re: Binary tx format for an array?] From: Mark Lewis To: Marc Herbert Cc: pgsql-jdbc@postgresql.org In-Reply-To: References: <30b57570606211026o66e337c9s658387db0b32aeed@mail.gmail.com> <17160.1150929667@sss.pgh.pa.us> <30b57570606220116h2f216c1eue74e5cfbb41bd5bc@mail.gmail.com> <1048.1150995309@sss.pgh.pa.us> <1151003773.21238.13.camel@archimedes> <1152548310.30994.260.camel@archimedes> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: MIR3, Inc. Date: Mon, 10 Jul 2006 11:59:42 -0700 Message-Id: <1152557982.30994.288.camel@archimedes> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-27) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/28 X-Sequence-Number: 15454 On Mon, 2006-07-10 at 19:54 +0200, Marc Herbert wrote: > My point is that it IS universally true in the Java universe AND in > the networking universe. There simply cannot be two opposed networking > universes... that would mean we'd have two Internets for instance? > > So I think the whole point of Java is that everything is big-endian, so > you do not need to know about endianness anymore. IMHO this is a > success. Just because Java is big-endian and this particular protocol is big- endian does not mean that the universe is big-endian. There are protocols which either always use little-endian, or allow the endian- ness of parameters to be negotiated for performance. One example is the TDS protocol, so you may want to look at the open source jTDS JDBC driver and see how they handle it. Your point is however well taken that there are more big-endian protocols out there than little-endian protocols, and Java works easily with those. > Interesting. Looks like you need this only when dealing with > badly-behaved applications that do not use the network order, right? > Should be very seldom, don't you think? It's not badly-behaving applications, it's protocols whose designers chose to use little-endian formatting, usually for performance reasons on common x86 hardware. -- Mark