Use fields for temp buffers in read() and write(int).

This avoids reallocating memory for each call.
This reduces pressure on the garbage collector
and in practice lowers the memory used by the
java process significantly when read() and
write(int) functions are used a lot.

On the other hand, this is stupid since most of the
time the read() and write(int) aren't (hopefully) used
since one gets better performance with functions that
process arrays of bytes. Thus, for most uses cases this
commit means that we are allocating a few unused one-byte
buffers that weren't previously allocated at all.

Similar thing was done earlier in the LZMA encoder in
the commit ec224582e44776a53874346dfe703dbbfcc6bd15.
14 files changed