public ByteBuffer getBuf() {
        if (myBuf.position() != 0) {
            throw new IllegalStateException("Call close() befor getBuf(), pos=" + myBuf.position() + ", limit=" + myBuf.limit());
        }
        return myBuf;
    }
Return a buffer ready for read. Must only be called after writer has been closed.

@return A flipped ByteBuffer
vespajlib/src/main/java/com/yahoo/io/Utf8ByteWriter.java