I'd like to know the equivalent of
cat inputfile | sed 's/\(.\)/\1\n/g' | sort | uniq -c
presented in https://stackoverflow.com/questions/4174113/how-to-gather-characters-usage-statistics-in-text-file-using-unix-commands for production of character usage statistics in text files for binary files counting simple bytes instead of characters, i.e. output should be in the form of
18383 57 12543 44 11555 127 8393 0
It doesn't matter if the command takes as long as the referenced one for characters.
If I apply the command for characters to binary files the output contains statistics for arbitrary long sequences of unprintable characters (I don't seek explanation for that).