io: fsync in flush

Fixes: #9679

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
io: use checkOpen helper to catch closed streams

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
doc: javadoc automatically inherits

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
io: use flushBuffer helper

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
io: use stack trace for context

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
io: use large buffer size

This update uses a larger buffer size in the i/o streams. The default
size is 4096. This cuts down on the number of times we cross the JNI
boundary. As an example running teravalidate on a 10GB data set won't
finish even after 10 or 15 minutes, but with a 2MB buffer it finishes in
2 minutes. Most likely because teravalidate is doing tiny reads.

When we support ByteBuffer interface we should be able to get rid of the
use of the java buffer completely and rely on buffering and caching in
libcephfs.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Merge pull request #16 from ceph/outputstream-cleanup

Outputstream cleanup, fsync fix, enlarge buffers

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>