Skip to content

Commit

Permalink
Better names for the thread-local streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Aug 29, 2016
1 parent ebe370b commit b26be37
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -47,8 +47,8 @@ public static RapidoidThreadLocals get() {
} }
} }


public final ByteArrayOutputStream baos1 = new ByteArrayOutputStream(); public final ByteArrayOutputStream jsonRenderingStream = new ByteArrayOutputStream();


public final ByteArrayOutputStream pageRenderingBaos = new ByteArrayOutputStream(); public final ByteArrayOutputStream pageRenderingStream = new ByteArrayOutputStream();


} }
Expand Up @@ -176,7 +176,7 @@ public static void writeContentLengthAndBody(Channel ctx, byte[] content) {
public static void writeAsJson(Channel ctx, int code, boolean isKeepAlive, Object value) { public static void writeAsJson(Channel ctx, int code, boolean isKeepAlive, Object value) {
startResponse(ctx, code, isKeepAlive, MediaType.JSON); startResponse(ctx, code, isKeepAlive, MediaType.JSON);


ByteArrayOutputStream os = Msc.locals().baos1; ByteArrayOutputStream os = Msc.locals().jsonRenderingStream;
os.reset(); os.reset();


JSON.stringify(value, os); JSON.stringify(value, os);
Expand Down
Expand Up @@ -111,7 +111,7 @@ public static byte[] renderPage(ReqImpl req, String content) {
MasterPage masterPage = Customization.of(req).masterPage(); MasterPage masterPage = Customization.of(req).masterPage();
U.must(masterPage != null, "A page renderer wasn't configured!"); U.must(masterPage != null, "A page renderer wasn't configured!");


ByteArrayOutputStream out = Msc.locals().pageRenderingBaos; ByteArrayOutputStream out = Msc.locals().pageRenderingStream;
out.reset(); out.reset();


try { try {
Expand Down

0 comments on commit b26be37

Please sign in to comment.