classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Re: [RFA/JDWP] Event basics


From: Keith Seitz
Subject: [cp-patches] Re: [RFA/JDWP] Event basics
Date: Thu, 23 Jun 2005 10:57:51 -0700

On Wed, 2005-06-22 at 23:45 +0200, Cedric Berger wrote:

>   public void toPacket(ByteBuffer bb, int requestId, byte suspendPolicy)
>     {
>       bb.put(suspendPolicy);
>       bb.putInt(1);
>       bb.put(_eventKind);
>       bb.putInt(requestId);
>       _writeData(bb);
>     }

That looks simple enough except for one problem: ByteBuffers are fixed-
size quantities, aren't they?

_writeData can put an arbitrarily large amount of data into the buffer.
For simply event notifications like a ThreadStart, the only data is the
eight-byte thread ID. For some events like ClassPrepare, we have random
strings that are going to be inserted into the buffer.

In order to accomplish allocating the properly sized buffer ahead of
time, I'd need to add methods to all these things to compute the size of
the data.

Would this be worth the added complexity and computation? I dunno. What
do you think?

Keith





reply via email to

[Prev in Thread] Current Thread [Next in Thread]