}
private synchronized String readNextChunk(int capacity)
throws IOException {
if (capacity == 0) {
throw new EndOfFileException("Zero chunk size, possibly end of file reached.");
}
ByteBuffer buf = ByteBuffer.allocateDirect(capacity);
byte[] dst = new byte[capacity];