This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [RFA/JDWP] Event basics
- From: Cedric Berger <cedric at berger dot to>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>, classpath patches <classpath-patches at gnu dot org>
- Date: Wed, 22 Jun 2005 23:45:47 +0200
- Subject: Re: [RFA/JDWP] Event basics
- References: <42B9BEF3.6010306@berger.to> <1119470106.4528.74.camel@lindt.uglyboxes.com>
Keith Seitz wrote:
Fact is, I haven't seen java.nio used much (it's all new to me).
Yeah, It is new in jdk 1.4, but this "new" api is not supposed to
replace the "old" one.
It is a lower-level API, somewhat less user-friendly, but faster and
more powerful
for this kind of packet-based, low-level applications. Also, you don't
need to use
threads, you've the C "poll()" function available.
I presume you mean a ByteBuffer?
Yes.
I'll have to keep that in mind for any outstanding work. Perhaps I'll
just get what I have finished and then switch everything over in one
fell swoop.
Makes sense. Actually, it wouldn't be that difficult to update the
code. The
toPacket could be replaced to write directly to a buffer, so it actually
becomes
much simpler, no more exceptions, allocations, ...
public void toPacket(ByteBuffer bb, int requestId, byte suspendPolicy)
{
bb.put(suspendPolicy);
bb.putInt(1);
bb.put(_eventKind);
bb.putInt(requestId);
_writeData(bb);
}
Cedric