Code example for ByteBuffer

Methods: position, put

0
        ByteBuffer rawBuf = allocBuffer(1);
        JdwpPacket packet = new JdwpPacket(rawBuf);
        ByteBuffer buf = getChunkDataBuf(rawBuf);
 
        if (enable)
            buf.put((byte)1);
        else 
            buf.put((byte)0);
 
        finishChunkPacket(packet, CHUNK_THEN, buf.position());
        Log.d("ddm-thread", "Sending " + name(CHUNK_THEN) + ": " + enable);
        client.sendAndConsume(packet, mInst);
    } 
 
 
    /** 
     * Send a STKL (STacK List) request to the client.  The VM will suspend 
     * the target thread, obtain its stack, and return it.  If the thread 
     * is no longer running, a failure result will be returned. 
     */ 
    public static void sendSTKL(Client client, int threadId)