Code example for ByteBuffer

Methods: position, putInt

0
 
        ByteBuffer rawBuf = allocBuffer(2*4);
        JdwpPacket packet = new JdwpPacket(rawBuf);
        ByteBuffer buf = getChunkDataBuf(rawBuf);
 
        buf.putInt(bufferSize);
        buf.putInt(flags);
 
        finishChunkPacket(packet, CHUNK_MPSS, buf.position());
        Log.d("ddm-prof", "Sending " + name(CHUNK_MPSS)
            + "', size=" + bufferSize + ", flags=" + flags);
        client.sendAndConsume(packet, mInst);
 
        // send a status query. this ensure that the status is properly updated if for some 
        // reason starting the tracing failed. 
        sendMPRQ(client);
    } 
 
    /** 
     * Send a MPSE (Method Profiling Streaming End) request to the client. 
     */