Java ByteArrayOutputStream reset() MethodThe reset() method of Java ByteArrayOutputStream class is used to reset the stream and makes the stream count =0 so that all currently accumulated output in the output stream is discarded. The output stream can be used again, reusing the already allocated buffer space. Syntax:Parameters:NA ReturnsNA Example 1Test it NowOutput: Before Resetting :A After Resetting :U Example 2Test it NowOutput: Before Resetting :K After Resetting :Z
Next TopicJava ByteArrayOutputStream Class
|