Package com.clickhouse.client.stream
Class BlockingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.clickhouse.client.ClickHouseInputStream
-
- com.clickhouse.client.stream.AbstractByteBufferInputStream
-
- com.clickhouse.client.stream.BlockingInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class BlockingInputStream extends AbstractByteBufferInputStream
ByteBufferbacked input stream withBlockingQueue.
-
-
Field Summary
-
Fields inherited from class com.clickhouse.client.stream.AbstractByteBufferInputStream
buffer
-
Fields inherited from class com.clickhouse.client.ClickHouseInputStream
byteBuffer, closed, copyTo, EMPTY_BUFFER, EMPTY_BYTES, ERROR_INCOMPLETE_READ, ERROR_NULL_BYTES, ERROR_REUSE_BUFFER, ERROR_STREAM_CLOSED, file, postCloseAction
-
-
Constructor Summary
Constructors Constructor Description BlockingInputStream(BlockingQueue<ByteBuffer> queue, int timeout, Runnable postCloseAction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidensureOpen()Checks whether the input stream has been closed and throw an exception if it is.protected intupdateBuffer()Update inner buffer as needed.-
Methods inherited from class com.clickhouse.client.stream.AbstractByteBufferInputStream
available, close, peek, pipe, read, read, readBuffer, readByte, readBytes, readCustom, skip
-
Methods inherited from class com.clickhouse.client.ClickHouseInputStream
closeQuietly, empty, getUnderlyingFile, isClosed, of, of, of, of, of, of, of, of, of, of, of, of, of, of, of, of, pipe, pipe, readAsciiString, readAsciiString, readString, readString, readUnicodeString, readUnicodeString, readUnsignedByte, readVarInt, readVarLong, save, save, setCopyToTarget, wrap
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, transferTo
-
-
-
-
Constructor Detail
-
BlockingInputStream
public BlockingInputStream(BlockingQueue<ByteBuffer> queue, int timeout, Runnable postCloseAction)
-
-
Method Detail
-
ensureOpen
protected void ensureOpen() throws IOExceptionDescription copied from class:ClickHouseInputStreamChecks whether the input stream has been closed and throw an exception if it is.- Overrides:
ensureOpenin classAbstractByteBufferInputStream- Throws:
IOException- when the input stream has been closed
-
updateBuffer
protected int updateBuffer() throws IOExceptionDescription copied from class:AbstractByteBufferInputStreamUpdate inner buffer as needed.- Specified by:
updateBufferin classAbstractByteBufferInputStream- Returns:
- remaining bytes in buffer
- Throws:
IOException- when failed to update buffer
-
-