This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: java.nio.ByteBuffer problem.
- From: Michael Koch <konqueror at gmx dot de>
- To: Bryce McKinlay <bryce at mckinlay dot net dot nz>, Rutger Ovidius <ovid at mailandnews dot com>
- Cc: java at gcc dot gnu dot org
- Date: Tue, 23 Sep 2003 07:29:07 +0200
- Subject: Re: java.nio.ByteBuffer problem.
- References: <C3506924-ED57-11D7-9184-003065F97F7C@mckinlay.net.nz>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am Dienstag, 23. September 2003 01:52 schrieb Bryce McKinlay:
> On Friday, Sep 19, 2003, at 09:24 Pacific/Auckland, Rutger Ovidius
>
> wrote:
> > Is this supported with gcj? All I get are 0's.
> >
> > gcc version 3.3.1 (mingw special 20030804-1)
>
> I tried this example with the current CVS libgcj. It gets more than
> 0's, but the result is incorrect as the current ByteBuffer
> implementation only supports ByteOrder.BIG_ENDIAN (ie Java byte
> order) - note the comments in ByteBufferImpl.java which claim it
> only supports LITTLE_ENDIAN are incorrect.
>
> It wouldn't be too hard to go through and add cases to the existing
> code to handle little endian as well, but I'm thinking there would
> be a lot to be gained by optimizing much of the buffer stuff, such
> as ByteBuffer.putInt() etc, with CNI methods. Anyone else want to
> comment on this? Michael?
Oops, I have responded to this but forgot to send a copy to the list.
This code is mess currently so I did a local rewrite of it. I added a
new class ByteBufferHelper to implement the get/putType methods
because ByteBufferImpl, DirectByteBufferImpl and MappedByteBufferImpl
all need the same code for this. Its currently written in pure Java.
I dont think we will gain much if we rewrite the methods with CNI
(and JNI for classpath). We can do some benchmarks when my new code
is in. Then we will see.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/b9ojWSOgCCdjSDsRAndTAKCYPisfNJVr7bqf5MicUOvm03j62wCeMcn0
Jj0zNdiCemKbYDq/cDBTZlM=
=RiNx
-----END PGP SIGNATURE-----