Browse CVS Repository
Diff of /pal/libraries/facesresponsefilter/src/main/java/jp/sf/pal/facesresponse/io/BufferedResponseStreamFactory.java
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 120 |
if (bufferedResponseStream == null) { |
if (bufferedResponseStream == null) { |
| 121 |
throw new IllegalStateException("BufferedResponseStream is null."); |
throw new IllegalStateException("BufferedResponseStream is null."); |
| 122 |
} |
} |
| 123 |
// flush stream |
synchronized (bufferedResponseStream) { |
| 124 |
bufferedResponseStream.commit(); |
// flush stream |
| 125 |
|
bufferedResponseStream.commit(); |
| 126 |
|
|
| 127 |
if (request.getWindowState() != WindowState.MINIMIZED) { |
if (request.getWindowState() != WindowState.MINIMIZED) { |
| 128 |
Reader r = bufferedResponseStream.getReader(); |
Reader r = bufferedResponseStream.getReader(); |
| 129 |
Writer w = response.getWriter(); |
Writer w = response.getWriter(); |
| 130 |
char[] bytes = new char[FacesResponseConstants.BLOCK_SIZE]; |
char[] bytes = new char[FacesResponseConstants.BLOCK_SIZE]; |
| 131 |
try { |
try { |
| 132 |
int length = r.read(bytes); |
int length = r.read(bytes); |
| 133 |
while (length != -1) { |
while (length != -1) { |
| 134 |
if (length != 0) { |
if (length != 0) { |
| 135 |
w.write(bytes, 0, length); |
w.write(bytes, 0, length); |
| 136 |
|
} |
| 137 |
|
length = r.read(bytes); |
| 138 |
} |
} |
| 139 |
length = r.read(bytes); |
} finally { |
| 140 |
|
bytes = null; |
| 141 |
} |
} |
| 142 |
} finally { |
w.flush(); |
|
bytes = null; |
|
| 143 |
} |
} |
|
w.flush(); |
|
| 144 |
} |
} |
| 145 |
|
|
| 146 |
// cleanup |
// cleanup |
|
|
Legend:
| Removed from v.1.2 |
|
| changed lines |
| |
Added in v.1.3 |
|
|
|