Refactorized convert(byte[], int, ...), now uses the pointer version.