agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] readBytes() / writeBytes()
Date: Thu, 21 Sep 2006 22:28:20 +0200
Message-ID: <4512F5E4.9060600@logix-tt.com> (raw)

Hi,

I just stumbled about the readBytes() / writeBytes() methods from
SQLInputFromChunk / SQLOutputFromChunk classes.

They seem to assume that every array has a 2-byte length header.

Where does this assumption come from? Are there some internal data types
that use this format?

I ask because I'm currently writing a pljava interface for the PostGIS
datatypes, and my hope was that readBytes() just reads the whole
(variable-length) datatype into the byte array.

Another issue is the endianness. For double, I assume that, at least on
IEEE floating point platforms, the layout is endian free. But readInt()
etc. seem to use big endian regardless of the underlying platform.

So it seems that I have to use readByte() and put everything together in
the right order on myself, right?

Btw, is does the stream include the 4-byte length header for variable
length datatypes? The examples seem to cover only fixed-size types.

Thanks,
Markus

-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20060921/fb5f2f43/attachment.bin;



view thread (13+ messages)  latest in thread

Message-ID: <4512F5E4.9060600@logix-tt.com>
Permalink:  ../4512F5E4.9060600@logix-tt.com/
Also on:    postgresql.org/message-id/4512F5E4.9060600@logix-tt.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] readBytes() / writeBytes()
  In-Reply-To: <4512F5E4.9060600@logix-tt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox