Code example for ByteBuffer

Methods: position, putInt

0
 
        ByteBuffer rawBuf = allocBuffer(3*4 + fileName.length() * 2);
        JdwpPacket packet = new JdwpPacket(rawBuf);
        ByteBuffer buf = getChunkDataBuf(rawBuf);
 
        buf.putInt(bufferSize);
        buf.putInt(flags);
        buf.putInt(fileName.length());
        putString(buf, fileName);
 
        finishChunkPacket(packet, CHUNK_MPRS, buf.position());
        Log.d("ddm-prof", "Sending " + name(CHUNK_MPRS) + " '" + fileName
            + "', size=" + bufferSize + ", flags=" + flags);
        client.sendAndConsume(packet, mInst);
 
        // record the filename we asked for. 
        client.getClientData().setPendingMethodProfiling(fileName);
 
        // send a status query. this ensure that the status is properly updated if for some 
        // reason starting the tracing failed. 
        sendMPRQ(client);