[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] Re: [RFA/JDWP] Event basics
From: |
Cedric Berger |
Subject: |
[cp-patches] Re: [RFA/JDWP] Event basics |
Date: |
Wed, 22 Jun 2005 23:45:47 +0200 |
User-agent: |
Mozilla Thunderbird 0.9 (Windows/20041103) |
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