T
- chunk type.public class ChunkedOutput<T> extends GenericType<T> implements Closeable
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(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 |
---|---|
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, getType
protected ChunkedOutput()
ChunkedOutput
.public 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 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
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public 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-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.