@Override
        public ClickHouseByteBuffer next() {
            try {
                ClickHouseByteBuffer buffer = input.nextBuffer();
                if (buffer.isEmpty() && input.available() < 1) {
                    throw new NoSuchElementException(
                            "No more byte buffer for read as we reached end of the stream");
                }
                return buffer;
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }
Extended input stream for read optimization. Methods like
{@link #readBuffer(int)}, {@link #readByte()}, {@link #readBytes(int)}, and
{@link #readCustom(ClickHouseDataUpdater)} are added to reduce object
creation as well as closing the stream when it reaches end of stream. This
class is also responsible for creating various input stream as needed.
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseInputStream.java