Code example for ByteBuffer

Methods: get, limit, rewind

0
            cd.addNativeAllocation(info);
        } 
    } 
 
    private void handleNHSG(Client client, ByteBuffer data) {
        byte dataCopy[] = new byte[data.limit()];
        data.rewind();
        data.get(dataCopy);
        data = ByteBuffer.wrap(dataCopy);
        client.getClientData().getNativeHeapData().addHeapData(data);
 
        if (true) { 
            return; 
        } 
 
        // WORK IN PROGRESS 
 
//        Log.e("ddm-nativeheap", "NHSG: ----------------------------------"); 
//        Log.e("ddm-nativeheap", "NHSG: " + data.limit() + " bytes"); 
 
        byte[] copy = new byte[data.limit()];