Code example for StringWriter

Methods: toString

0
 
    assertEquals(expectedOutput, output);
  } 
 
  private String inputStreamToString(InputStream stream) throws IOException {
    StringWriter writer = new StringWriter();
    IOUtils.copy(stream, writer);
    return writer.toString();
  } 
 
  private void createAvroFile(byte[] contents) throws IOException {
    (new File(TEST_ROOT_DIR)).mkdir();
    File file = new File(AVRO_FILENAME);
    file.createNewFile();
    FileOutputStream stream = new FileOutputStream(file);
    stream.write(contents);
    stream.close();
  } 
 
  private byte[] generateWeatherAvroBinaryData() { 
Contextual code suggestions in your IDE  Get Codota for Java