src/io/github/marwlod/burrows_wheeler/MoveToFront.java
// apply move-to-front decoding, reading from standard input and writing to standard output
apply move-to-front decoding, reading from standard input and writing to standard output
apply move - to - front decoding reading from standard input and writing to standard output
public static void decode() {
        char[] asciiTable = new char[EXT_ASCII_SIZE];
        for (int i = 0; i < asciiTable.length; i++) {
            asciiTable[i] = (char) i;
        }
        while (!BinaryStdIn.isEmpty()) {
            char c = BinaryStdIn.readChar();
            BinaryStdOut.write(asciiTable[c], 8);
            for (int i = c; i > 0; i--) {
                swap(asciiTable, i, i-1);
            }
        }
        BinaryStdOut.flush();
    }
public static void decode ( ) { char [ ] asciiTable = new char [ EXT_ASCII_SIZE ] ; for ( int i = 0 ; i < asciiTable . length ; i ++ ) { asciiTable [ i ] = ( char ) i ; } while ( ! BinaryStdIn . isEmpty ( ) ) { char c = BinaryStdIn . readChar ( ) ; BinaryStdOut . write ( asciiTable [ c ] , 8 ) ; for ( int i = c ; i > 0 ; i -- ) { swap ( asciiTable , i , i - 1 ) ; } } BinaryStdOut . flush ( ) ; }
apply move-to-front decoding, reading from standard input and writing to standard output
apply move - to - front decoding reading from standard input and writing to standard output