Javatpoint Logo
Javatpoint Logo

Java ByteArrayOutputStream write() method

The write() method of Java ByteArrayOutputStream class is used to write len bytes from the specified byte array standing at offset off to this byte array output stream.

Syntax:

Overrides

write() method in class OutputStream.

Parameters:

b- the data.

off- the start offset in the data.

len- the number of byte to write.

Returns

NA

Example 1

Test it Now

Output:

Java

Example 2

Test it Now

Output:

Java ByteArrayOutputStream write() method

Java ByteArrayOutputStream write() method

The write() method is used to write the specified bytes to this output stream.

Syntax:

Parameters:

b-the byte to be written

Specified By:

write() in class OutputStream.

Example 1

Test it Now

Output:

ABC

Example 2

Test it Now

Output:

WXYZ






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