Micro optimizations.

- The most important one is to use @specialized with NioBuffer to avoid
boxing for each access to Byte/Int/Float/Double buffer.
- Also some transformations of methods into fields.