This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/JDWP] Event basics


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]