public class ServletOutputStream extends javax.servlet.ServletOutputStream implements Recyclable, NettyOutputStream
| 限定符和类型 | 类和说明 |
|---|---|
class |
ServletOutputStream.CloseListener
Closing the listening wrapper class (for data collection)
|
| 限定符和类型 | 字段和说明 |
|---|---|
static ServletResetBufferIOException |
RESET_BUFFER_EXCEPTION |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
End response object
The following events indicate that the servlet has satisfied the request and the response object is about to close
The following events indicate that the servlet has satisfied the request and the response object is about to close:
■The service method of the servlet terminates.
|
void |
flush()
batch send packet.
|
long |
getWriteBytes() |
boolean |
isClosed()
Whether to shut down
|
boolean |
isReady() |
static ServletOutputStream |
newInstance(ServletHttpExchange servletHttpExchange) |
<T> void |
recycle(Consumer<T> consumer)
async recycle
|
void |
setCloseListener(io.netty.channel.ChannelFutureListener closeListener) |
void |
setWriteListener(javax.servlet.WriteListener writeListener) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
io.netty.channel.ChannelProgressivePromise |
write(io.netty.buffer.ByteBuf httpBody)
direct write to tcp outputStream
|
io.netty.channel.ChannelProgressivePromise |
write(ByteBuffer httpBody)
direct write to tcp outputStream.
|
io.netty.channel.ChannelProgressivePromise |
write(io.netty.handler.stream.ChunkedInput input)
use netty batch write
|
io.netty.channel.ChannelProgressivePromise |
write(File httpBody)
use netty zero copy
|
io.netty.channel.ChannelProgressivePromise |
write(FileChannel fileChannel,
long position,
long count)
use netty zero copy
|
io.netty.channel.ChannelProgressivePromise |
write(File file,
long position,
long count)
use netty zero copy
|
void |
write(int b)
Int.
|
print, print, print, print, print, print, print, println, println, println, println, println, println, println, printlnrecyclepublic static final ServletResetBufferIOException RESET_BUFFER_EXCEPTION
public static ServletOutputStream newInstance(ServletHttpExchange servletHttpExchange)
public long getWriteBytes()
public io.netty.channel.ChannelProgressivePromise write(ByteBuffer httpBody) throws IOException
NettyOutputStreamwrite 在接口中 NettyOutputStreamhttpBody - jdk ByteBuffer httpBodyIOException - if closeMappedByteBuffer,
ByteBufferpublic io.netty.channel.ChannelProgressivePromise write(io.netty.buffer.ByteBuf httpBody)
throws IOException
NettyOutputStreamwrite 在接口中 NettyOutputStreamhttpBody - netty ByteBuf httpBodyIOException - if closeChunkedFile,
ChunkedNioStream,
ChunkedNioFile,
ChunkedStreampublic io.netty.channel.ChannelProgressivePromise write(io.netty.handler.stream.ChunkedInput input)
throws IOException
NettyOutputStreamwrite 在接口中 NettyOutputStreaminput - ChunkedInput httpBodyIOException - if closeChunkedFile,
ChunkedNioStream,
ChunkedNioFile,
ChunkedStreampublic io.netty.channel.ChannelProgressivePromise write(FileChannel fileChannel, long position, long count) throws IOException
NettyOutputStreamwrite 在接口中 NettyOutputStreamfileChannel - FileChannel httpBodyposition - positioncount - countChannelProgressivePromise.addListener(GenericFutureListener) }IOException - if closeGenericProgressiveFutureListenerpublic io.netty.channel.ChannelProgressivePromise write(File file, long position, long count) throws IOException
NettyOutputStreamwrite 在接口中 NettyOutputStreamfile - File httpBodyposition - positioncount - countChannelProgressivePromise.addListener(GenericFutureListener) }IOException - if closeGenericProgressiveFutureListenerpublic io.netty.channel.ChannelProgressivePromise write(File httpBody) throws IOException
NettyOutputStreamwrite 在接口中 NettyOutputStreamhttpBody - File httpBodyChannelProgressivePromise.addListener(GenericFutureListener) }IOException - if closeGenericProgressiveFutureListenerpublic void write(byte[] b,
int off,
int len)
throws IOException
write 在类中 OutputStreamIOExceptionpublic boolean isReady()
isReady 在类中 javax.servlet.ServletOutputStreampublic void setWriteListener(javax.servlet.WriteListener writeListener)
setWriteListener 在类中 javax.servlet.ServletOutputStreampublic void setCloseListener(io.netty.channel.ChannelFutureListener closeListener)
public void write(byte[] b)
throws IOException
write 在类中 OutputStreamIOExceptionpublic void write(int b)
throws IOException
write 在类中 OutputStreamb - byteIOException - IOExceptionpublic void flush()
throws IOException
NettyOutputStreamflush 在接口中 NettyOutputStreamflush 在接口中 Flushableflush 在类中 OutputStreamIOException - if closepublic void close()
close 在接口中 NettyOutputStreamclose 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 OutputStreampublic boolean isClosed()
public <T> void recycle(Consumer<T> consumer)
Recyclablerecycle 在接口中 RecyclableT - last recycle objectconsumer - callbackCopyright © 2021. All rights reserved.