The use of streams can boost the performance of your application. |
Here is a simple example assuming that the aforementioned method implements the prototype:
Here is the example:class IMyClass implements Closeable {void someMethod(OutputStream s);}
IMyClass xyz = ...; // Initialize your objectByteArrayOutputStream baos = new ByteArrayOutputStream();someMethod(baos);xyz.close(); // First close your object (it's closeable)String your_result = baos.toString();baos.close();
No comments:
Post a Comment