Class VertxInputStream
java.lang.Object
java.io.InputStream
io.mishmash.opentelemetry.server.collector.VertxInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An
InputStream that takes a Vert.x
ReadStream and reads it
up to a given number of bytes.
Used to limit the number of bytes a client can upload
allowing for the upload to not be stored temporarily,
but rather to be processed on the fly.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final io.vertx.core.buffer.BufferSpecial constant to mark this input stream as having reached the last input.protected static final io.vertx.core.buffer.BufferSpecial constant to mark this input stream as having reached an error. -
Constructor Summary
ConstructorsConstructorDescriptionVertxInputStream(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> readStream, long maxBytesToRead) Create a new stream. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
END_BUF
protected static final io.vertx.core.buffer.Buffer END_BUFSpecial constant to mark this input stream as having reached the last input. -
EXCEPTION_BUF
protected static final io.vertx.core.buffer.Buffer EXCEPTION_BUFSpecial constant to mark this input stream as having reached an error.
-
-
Constructor Details
-
VertxInputStream
public VertxInputStream(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> readStream, long maxBytesToRead) Create a new stream.- Parameters:
readStream- the input to read frommaxBytesToRead- the maximum number of input bytes allowed
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
addBuffer
protected void addBuffer(io.vertx.core.buffer.Buffer b) Queues the next inputBuffer.- Parameters:
b- the input buffer
-
handleStreamEnd
Called when there will be no more input buffers.- Parameters:
v- - a void
-
handleStreamException
Called upon errors.- Parameters:
t- the error encountered
-