Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public abstract class AbstractServletOutput extends ServletOutputStream {

/**
* create a new AbstractServlet
*
* @param res the response
* @param position bytebuffer position (free space in the start)
*/
Expand Down Expand Up @@ -54,6 +55,7 @@ public final int getBufferSize() {

/**
* set the buffer size
*
* @param bufferSize the size
*/
public final void setBufferSize(int bufferSize) {
Expand Down Expand Up @@ -85,6 +87,7 @@ protected final void ensureOpen() throws IOException {

/**
* called after the stream is closed
*
* @throws IOException on error
*/
protected void afterClose() throws IOException { // for override
Expand Down Expand Up @@ -126,7 +129,7 @@ public void write(byte[] b, int off, int len) throws IOException {
return;
off += l;
if (len >= bufferSize) {
ByteBuffer buf = ByteBuffer.allocate(len + position).position(position + len);
ByteBuffer buf = ByteBuffer.allocate(len + position).position(position);
System.arraycopy(b, off, buf.array(), position, len);
writeBuffer(buf);
} else
Expand Down