Snippets tagged “outputstream”
2 snippets use this tag.
- Easy way to write contents of a Java InputStream to an OutputStreamJava
One way to write the contents of a Java InputStream to an OutputStream is to use the read and write methods of the InputStream and OutputStream classes.
- Get an OutputStream into a StringJava
To get an OutputStream into a String, you can use a ByteArrayOutputStream as the OutputStream and then use the toString() method of the ByteArrayOutputStream to get the contents of the stream as a string.