I have two object:
BufferedReader br;
CMSSignedData cms;
I have to write cms content to BufferedReader
cms has this method:
cms.getSignedContent().write(OutputStream os);
But how to get the OutputStream
from BufferedReader
?
This is my attemp:
ByteArrayOutputStream os=new ByteArrayOutputStream();
cms.getSignedContent().write(os);
InputStream is=new ByteArrayInputStream(os.toByteArray());
BufferedReader br = new BufferedReader(new InputStreamReader(is));
But I don't think this is the best way.