public class OutputBuffer
extends java.io.Writer
| Modifier and Type | Field and Description |
|---|---|
protected C2BConverter |
conv
Current char to byte converter.
|
static int |
DEFAULT_BUFFER_SIZE |
| Constructor and Description |
|---|
OutputBuffer(int size)
Create the buffer with the specified initial size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(byte[] src,
int off,
int len)
Add data to the buffer.
|
void |
append(java.nio.ByteBuffer from) |
void |
append(char[] src,
int off,
int len)
Add data to the buffer.
|
void |
checkConverter() |
void |
checkRegisterForWrite() |
void |
close()
Close the output buffer.
|
protected void |
doFlush(boolean realFlush)
Flush bytes or chars contained in the buffer.
|
void |
flush()
Flush bytes or chars contained in the buffer.
|
int |
getBufferSize() |
long |
getContentWritten() |
boolean |
isBlocking() |
boolean |
isClosed()
Is the response output closed ?
|
boolean |
isNew()
Has this buffer been used at all?
|
boolean |
isReady() |
boolean |
isSuspended()
Is the response output suspended ?
|
void |
realWriteBytes(java.nio.ByteBuffer buf)
Sends the buffer data to the client output, checking the
state of Response and calling the right interceptors.
|
void |
realWriteChars(java.nio.CharBuffer from)
Convert the chars to bytes, then send the data to the client.
|
void |
recycle()
Recycle the output buffer.
|
void |
reset() |
void |
reset(boolean resetWriterStreamFlags) |
void |
setBufferSize(int size) |
void |
setResponse(Response coyoteResponse)
Associated Coyote response.
|
void |
setSuspended(boolean suspended)
Set the suspended flag.
|
void |
setWriteListener(WriteListener listener) |
void |
write(byte[] b,
int off,
int len) |
void |
write(java.nio.ByteBuffer from) |
void |
write(char[] c) |
void |
write(char[] c,
int off,
int len) |
void |
write(int c) |
void |
write(java.lang.String s) |
void |
write(java.lang.String s,
int off,
int len)
Append a string to the buffer
|
void |
writeByte(int b) |
public static final int DEFAULT_BUFFER_SIZE
protected C2BConverter conv
public OutputBuffer(int size)
size - Buffer size to usepublic void setResponse(Response coyoteResponse)
coyoteResponse - Associated Coyote responsepublic boolean isSuspended()
public void setSuspended(boolean suspended)
suspended - New suspended flag valuepublic boolean isClosed()
public void recycle()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Writerjava.io.IOException - An underlying IOException occurredpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOException - An underlying IOException occurredprotected void doFlush(boolean realFlush)
throws java.io.IOException
realFlush - true if this should also cause a real network flushjava.io.IOException - An underlying IOException occurredpublic void realWriteBytes(java.nio.ByteBuffer buf)
throws java.io.IOException
buf - the ByteBuffer to be written to the responsejava.io.IOException - An underlying IOException occurredpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void write(java.nio.ByteBuffer from)
throws java.io.IOException
java.io.IOExceptionpublic void writeByte(int b)
throws java.io.IOException
java.io.IOExceptionpublic void realWriteChars(java.nio.CharBuffer from)
throws java.io.IOException
from - Char buffer to be written to the responsejava.io.IOException - An underlying IOException occurredpublic void write(int c)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void write(char[] c)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void write(char[] c,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void write(java.lang.String s,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void write(java.lang.String s)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void checkConverter()
throws java.io.IOException
java.io.IOExceptionpublic long getContentWritten()
public boolean isNew()
recycle()public void setBufferSize(int size)
public void reset()
public void reset(boolean resetWriterStreamFlags)
public int getBufferSize()
public boolean isReady()
public void setWriteListener(WriteListener listener)
public boolean isBlocking()
public void checkRegisterForWrite()
public void append(byte[] src,
int off,
int len)
throws java.io.IOException
src - Bytes arrayoff - Offsetlen - Lengthjava.io.IOException - Writing overflow data to the output channel failedpublic void append(char[] src,
int off,
int len)
throws java.io.IOException
src - Char arrayoff - Offsetlen - Lengthjava.io.IOException - Writing overflow data to the output channel failedpublic void append(java.nio.ByteBuffer from)
throws java.io.IOException
java.io.IOExceptionCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.