forked from sitemesh/sitemesh2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sitemesh#34 fix calling .resetBuffer() / .reset() has no effect on co…
…m.opensymphony.module.sitemesh.filter.PageResponseWrapper
- Loading branch information
Showing
5 changed files
with
84 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
|
||
package com.opensymphony.module.sitemesh.util; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.io.UnsupportedEncodingException; | ||
|
@@ -25,7 +24,7 @@ | |
* @author <a href="mailto:[email protected]">Scott Farquhar</a> | ||
* @version $Revision: 1.2 $ | ||
*/ | ||
public class FastByteArrayOutputStream extends ByteArrayOutputStream { | ||
public class FastByteArrayOutputStream extends OutputStream { | ||
private static final int DEFAULT_BLOCK_SIZE = 8192; | ||
|
||
/** Internal buffer. */ | ||
|
@@ -125,8 +124,9 @@ else if ((offset < 0) || (offset + length > data.length) | |
} | ||
} | ||
|
||
public synchronized void reset() { | ||
buffer = new byte[blockSize]; | ||
public void reset() { | ||
index = 0; | ||
size = 0; | ||
buffers = null; | ||
} | ||
|
||
|
@@ -137,12 +137,4 @@ public String toString(String enc) throws UnsupportedEncodingException { | |
public String toString() { | ||
return new String(toByteArray()); | ||
} | ||
|
||
public void flush() throws IOException { | ||
// does nothing | ||
} | ||
|
||
public void close() throws IOException { | ||
// does nothing | ||
} | ||
} |