Click here to watch in Youtube :
https://www.youtube.com/watch?v=EIFQOTfjpOw&list=UUhwKlOVR041tngjerWxVccw
ByteArrayOutputStreamDemo.java
import java.io.ByteArrayOutputStream; import java.io.IOException; public class ByteArrayOutputStreamDemo { public static void main(String[] args) throws IOException { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); byteArrayOutputStream.write("Hello world".getBytes()); System.out.println("byteArrayOutputStream = " + byteArrayOutputStream); /* * Returns the current size of the buffer. */ System.out.println("size = " + byteArrayOutputStream.size()); byteArrayOutputStream.close(); } }
byteArrayOutputStream = Hello world size = 11
https://sites.google.com/site/ramj2eev1/home/javabasics/JavaIODemo_ByteArrayOS_size_method_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/JavaIODemo_ByteArrayOS_size_method_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/d261aab7f0b47dd247e532c02763fe1d7053f5d3/BasicJava/JavaIODemo_ByteArrayOS_size_method_App/?at=master
See also:
No comments:
Post a Comment