test_class.file: agent/core/src/test/java/org/jolokia/util/IoUtilTest.java
test_class.identifier: IoUtilTest
test_case.body: @Test
      public void checkSmallWrite() throws IOException {
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          OutputStreamWriter writer = new OutputStreamWriter(out, "UTF-8");
  
          JSONObject resp = new JSONObject();
          resp.put("value", "hello");
          String respString = resp.toJSONString();
  
          IoUtil.streamResponseAndClose(writer,resp,null);
          assertEquals(out.size(), respString.length());
          assertEquals(out.toString("UTF-8"), respString);
          assertWriterClosed(writer);
      }
test_case.class_method_signature: IoUtilTest.checkSmallWrite()
test_case.full_signature: @Test public void checkSmallWrite()
test_case.identifier: checkSmallWrite
test_case.invocations: put toJSONString streamResponseAndClose assertEquals size length assertEquals toString assertWriterClosed
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void checkSmallWrite()
focal_class.declarator: STREAM_END_MARKER = {}
focal_class.modifier: private final static
focal_class.original_string: private final static char[] STREAM_END_MARKER = {};
focal_class.type: char[]
focal_class.var_name: STREAM_END_MARKER
focal_class.file: agent/core/src/main/java/org/jolokia/util/IoUtil.java
focal_class.identifier: IoUtil
focal_class.class_method_signature: IoUtil.IoUtil()
focal_class.full_signature: private  IoUtil()
focal_class.identifier: IoUtil
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  IoUtil()
focal_class.class_method_signature: IoUtil.streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback)
focal_class.full_signature: public static void streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback)
focal_class.identifier: streamResponseAndClose
focal_class.modifiers: public static
focal_class.parameters: (Writer pWriter, JSONStreamAware pJson, String callback)
focal_class.return: void
focal_class.signature: void streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback)
focal_method.body: public static void streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback)
          throws IOException {
          try {
              if (callback == null) {
                  pJson.writeJSONString(pWriter);
              } else {
                  pWriter.write(callback);
                  pWriter.write("(");
                  pJson.writeJSONString(pWriter);
                  pWriter.write(");");
              }
              // Writer end marker for chunked responses
              pWriter.write(STREAM_END_MARKER);
          } finally {
              // Flush and close, even on an exception to avoid locks in the thread
              pWriter.flush();
              pWriter.close();
          }
      }
focal_method.class_method_signature: IoUtil.streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback)
focal_method.full_signature: public static void streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback)
focal_method.identifier: streamResponseAndClose
focal_method.invocations: writeJSONString write write writeJSONString write write flush close
focal_method.modifiers: public static
focal_method.parameters: (Writer pWriter, JSONStreamAware pJson, String callback)
focal_method.return: void
focal_method.signature: void streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback)