Input and Output in Java
Input and Output in Java
OutputStream class is an
Method Description abstract class. It is the superclass
of all classes representing an
public void write(int)throws is used to write a byte to the output stream of bytes. An
IOException current output stream. output stream accepts output
bytes and sends them to some
sink.
public void write(byte[])throws is used to write an array of byte
IOException to the current output stream.
Method Description
public void write(int)throws is used to write a byte to the
IOException current output stream.
Method Description
protected void finalize() It is used to clean up the connection with the file output stream.
void write(byte[] ary) It is used to write ary.length bytes from the byte array to the file output stream.
void write(byte[] ary, int It is used to write len bytes from the byte array starting at offset off to the file output
off, int len) stream.
void write(int b) It is used to write the specified byte to the file output stream.
FileChannel getChannel() It is used to return the file channel object associated with the file output stream.
FileDescriptor getFD() It is used to return the file descriptor associated with the stream.
Method Description
public void write(int)throws is used to write a byte to the
IOException current output stream.
Method Description
It is used to return the estimated number of bytes that can be read from the input
int available()
stream.
int read() It is used to read the byte of data from the input stream.
int read(byte[] b) It is used to read up to b.length bytes of data from the input stream.
int read(byte[] b, int off, int len) It is used to read up to len bytes of data from the input stream.
long skip(long x) It is used to skip over and discards x bytes of data from the input stream.
It is used to return the unique FileChannel object associated with the
FileChannel getChannel()
file input stream.
FileDescriptor getFD() It is used to return the FileDescriptor object.
It is used to ensure that the close method is call when there is no more reference to
protected void finalize()
the file input stream.
void close() It is used to closes the stream.