Javatpoint Logo
Javatpoint Logo

Java FileOutputStream getChannel() Method

Java getChannel() method of FileOutputStream class is used to get the unique FileChannel object associated with this file output stream.

Syntax

Parameter

NA

Return Value

This method returns the file channel associated with this file output stream.

Exception

NA

Example 1

Java program to get the file channel

Output:

Enter a string to get the file channel------>
ashu
String that is stored in the JavaTpoint Txt file ------>ashu

file channel associated with this stream is----->sun.nio.ch.FileChannelImpl@30c7da1e

Example 2

Java Program to get the file channel

Output:

Enter a string to get the file channel------>
ashu
file channel associated with this stream is----->sun.nio.ch.FileChannelImpl@30c7da1e





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