Code example for ByteBuffer

Methods: position, putInt

0
 
        ByteBuffer rawBuf = allocBuffer(4);
        JdwpPacket packet = new JdwpPacket(rawBuf);
        ByteBuffer buf = getChunkDataBuf(rawBuf);
 
        buf.putInt(threadId);
 
        finishChunkPacket(packet, CHUNK_STKL, buf.position());
        Log.d("ddm-thread", "Sending " + name(CHUNK_STKL) + ": " + threadId);
        client.sendAndConsume(packet, mInst);
    } 
 
 
    /** 
     * This is called periodically from the UI thread.  To avoid locking 
     * the UI while we request the updates, we create a new thread. 
     * 
     */ 
    static void requestThreadUpdate(final Client client) {
        if (client.isDdmAware() && client.isThreadUpdateEnabled()) {
            if (mThreadStatusReqRunning) {