Javatpoint Logo
Javatpoint Logo

Java ByteArrayOutputStream size() method

The size() method of Java ByteArrayOutput class returns the current size of buffer.

Syntax:

Returns

The size() method returns the value of the count field which is the number of valid bytes in this output stream.

Example 1

Test it Now

Output:

1:V
2:VW
3:VWX
4:VWXY
5:VWXYZ

Example 2

Test it Now

Output:

1:G
2:GH
3:GHI
4:GHIJ






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA