Code example for ByteBuffer

Methods: rewind

0
    { 
        try 
        { 
            initContext(szPartition);
 
            dataOut.rewind();
 
            if (m_encryptCipher == null)
                throw new NullPointerException("m_encryptCipher == null");
 
            /* ********************************************************* 
             * Work around Android 4 bug: 
             * http://code.google.com/p/android/issues/detail?id=24327  
             */ 
            ByteBuffer input = ByteBuffer.allocate(dataIn.capacity());
            input.put(dataIn);
            input.rewind();
            /* ******************************************************* */ 
 
            m_encryptCipher.doFinal(input, dataOut);