public class OutputBuffer extends Writer implements org.glassfish.grizzly.http.util.ByteChunk.ByteOutputChannel
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE |
static String |
DEFAULT_ENCODING |
Constructor and Description |
---|
OutputBuffer()
Default constructor.
|
OutputBuffer(int size)
Alternate constructor which allows specifying the initial buffer size.
|
Modifier and Type | Method and Description |
---|---|
void |
checkConverter() |
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.
|
void |
flushBytes()
Real write - this buffer will be sent to the client
|
int |
getBufferSize() |
int |
getBytesWritten() |
int |
getCharsWritten() |
int |
getContentWritten() |
boolean |
hasData()
Are there any pending writes waiting to be flushed?
|
boolean |
isNew()
True if this buffer hasn't been used ( since recycle() ) -
i.e.
|
boolean |
isReady() |
boolean |
isSuspended()
Is the response output suspended ?
|
void |
realWriteBytes(byte[] buf,
int off,
int cnt)
Sends the buffer data to the client output, checking the
state of Response and calling the right interceptors.
|
void |
recycle()
Recycle the output buffer.
|
void |
reset() |
void |
setBufferSize(int size) |
void |
setCoyoteResponse(Response coyoteResponse) |
void |
setSuspended(boolean suspended)
Set the suspended flag.
|
void |
setWriteListener(javax.servlet.WriteListener writeListener) |
void |
write(byte[] b,
int off,
int len) |
void |
write(char[] c) |
void |
write(char[] c,
int off,
int len) |
void |
write(int c) |
void |
write(String s) |
void |
write(String s,
int off,
int len)
Append a string to the buffer
|
void |
writeByte(int b) |
public static final String DEFAULT_ENCODING
public static final int DEFAULT_BUFFER_SIZE
public OutputBuffer()
public OutputBuffer(int size)
size
- Buffer size to usepublic void setCoyoteResponse(Response coyoteResponse)
public boolean isSuspended()
public void setSuspended(boolean suspended)
suspended
- New suspended flag valuepublic void recycle()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Writer
IOException
- An underlying IOException occurredpublic void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
- An underlying IOException occurredprotected void doFlush(boolean realFlush) throws IOException
IOException
- An underlying IOException occurredpublic void realWriteBytes(byte[] buf, int off, int cnt) throws IOException
realWriteBytes
in interface org.glassfish.grizzly.http.util.ByteChunk.ByteOutputChannel
buf
- Byte buffer to be written to the responseoff
- Offsetcnt
- LengthIOException
- An underlying IOException occurredpublic void write(byte[] b, int off, int len) throws IOException
IOException
public void writeByte(int b) throws IOException
IOException
public void write(int c) throws IOException
write
in class Writer
IOException
public void write(char[] c) throws IOException
write
in class Writer
IOException
public void write(char[] c, int off, int len) throws IOException
write
in class Writer
IOException
public void write(String s, int off, int len) throws IOException
write
in class Writer
IOException
public void write(String s) throws IOException
write
in class Writer
IOException
public void checkConverter() throws IOException
IOException
public void flushBytes() throws IOException
IOException
public int getBytesWritten()
public int getCharsWritten()
public int getContentWritten()
public boolean isNew()
public void setBufferSize(int size)
public void reset()
public int getBufferSize()
public boolean isReady()
public void setWriteListener(javax.servlet.WriteListener writeListener)
public boolean hasData()
Copyright © 2020. All rights reserved.