Code example for ByteArrayOutputStream

Methods: writeTo

0
	public void writeTo(OutputStream os) throws IOException {
		if (os == null) {
			throw new IllegalArgumentException("Output stream may not be null");
		} 
		os.write(BODY_HEADER.getBytes("ascii"));
		mImageStream.writeTo(os);
		os.write(BODY_TRAILER.getBytes("ascii"));
		os.flush();
	} 
 
} 
Connect your IDE to all the code out there  Get Codota for Java