T - chunk type.public class ChunkedOutput<T> extends GenericType<T> implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
ChunkedOutput.Builder<Y>
Builder that allows to create a new ChunkedOutput based on the given configuration options.
|
static class |
ChunkedOutput.TypedBuilder<Y>
Builder that allows to create a new ChunkedOutput based on the given configuration options.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ChunkedOutput()
Create new
ChunkedOutput. |
protected |
ChunkedOutput(byte[] chunkDelimiter)
Create new
ChunkedOutput with a custom chunk delimiter. |
protected |
ChunkedOutput(byte[] chunkDelimiter,
jakarta.inject.Provider<AsyncContext> asyncContextProvider)
Create new
ChunkedOutput with a custom chunk delimiter. |
protected |
ChunkedOutput(ChunkedOutput.Builder<T> builder)
Create new
ChunkedOutput based on builder. |
protected |
ChunkedOutput(String chunkDelimiter)
Create new
ChunkedOutput with a custom chunk delimiter. |
|
ChunkedOutput(Type chunkType)
Create
ChunkedOutput with specified type. |
|
ChunkedOutput(Type chunkType,
byte[] chunkDelimiter)
Create new
ChunkedOutput with a custom chunk delimiter. |
|
ChunkedOutput(Type chunkType,
String chunkDelimiter)
Create new
ChunkedOutput with a custom chunk delimiter. |
| Modifier and Type | Method and Description |
|---|---|
static <T> ChunkedOutput.Builder<T> |
builder()
Returns a builder to create a ChunkedOutput with custom configuration.
|
static <T> ChunkedOutput.TypedBuilder<T> |
builder(Type chunkType)
Returns a builder to create a ChunkedOutput with custom configuration.
|
void |
close()
Close this response - it will be finalized and underlying connections will be closed
or made available for another response.
|
boolean |
equals(Object obj) |
protected void |
flushQueue() |
int |
hashCode() |
boolean |
isClosed()
Get state information.
|
protected void |
onClose(Exception e)
Executed only in case of close being triggered by client.
|
String |
toString() |
void |
write(T chunk)
Write a chunk.
|
forInstance, getRawType, getTypeprotected ChunkedOutput()
ChunkedOutput.protected ChunkedOutput(ChunkedOutput.Builder<T> builder)
ChunkedOutput based on builder.builder - the builder to usepublic ChunkedOutput(Type chunkType)
ChunkedOutput with specified type.chunkType - chunk type. Must not be {code null}.protected ChunkedOutput(byte[] chunkDelimiter)
ChunkedOutput with a custom chunk delimiter.chunkDelimiter - custom chunk delimiter bytes. Must not be {code null}.protected ChunkedOutput(byte[] chunkDelimiter,
jakarta.inject.Provider<AsyncContext> asyncContextProvider)
ChunkedOutput with a custom chunk delimiter.chunkDelimiter - custom chunk delimiter bytes. Must not be {code null}.public ChunkedOutput(Type chunkType, byte[] chunkDelimiter)
ChunkedOutput with a custom chunk delimiter.chunkType - chunk type. Must not be {code null}.chunkDelimiter - custom chunk delimiter bytes. Must not be {code null}.protected ChunkedOutput(String chunkDelimiter)
ChunkedOutput with a custom chunk delimiter.chunkDelimiter - custom chunk delimiter string. Must not be {code null}.public static <T> ChunkedOutput.Builder<T> builder()
public static <T> ChunkedOutput.TypedBuilder<T> builder(Type chunkType)
chunkType - chunk type. Must not be {code null}.public void write(T chunk) throws IOException
chunk - a chunk instance to be written.IOException - if this response is closed or when encountered any problem during serializing or writing a chunk.protected void flushQueue()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic boolean isClosed()
ChunkedOutput can be closed by the client side - client can close connection
from its side.protected void onClose(Exception e)
e - Exception causing the closepublic boolean equals(Object obj)
equals in class GenericType<T>public int hashCode()
hashCode in class GenericType<T>public String toString()
toString in class GenericType<T>Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.