Using direct buffers for reads, to avoid copy of the bytes by the
JDK, and because they yield better performance for masking.
Improved masking performance by using ints instead of bytes.