Javatpoint Logo
Javatpoint Logo

Java ByteArrayOutputStream writeTo() method

The writeTo() method of Java ByteArrayOutputStream class is used to write the complete contents of this byte array output to the specified output stream argument.

Syntax:

Parameters:

out - The specified output stream to be written to.

Throws

IOException - if an I/O error occurs.

Return

NA

Example 1

Test it Now

Output:

EFGH

Example 2

Test it Now

Output:

ABCD






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