Java OutputStreamWriter
Java OutputStreamWriter is a class that writes characters to an OutputStream and encodes them into bytes using a specified character set. It is a bridge between character streams and byte streams.
Here are some of the methods available in the OutputStreamWriter class:
write(int c): This method writes a single character to the output stream.write(char[] cbuf): This method writes characters from thecbufcharacter array to the output stream.write(char[] cbuf, int off, int len): This method writes up tolencharacters from thecbufcharacter array, starting at the specifiedoffoffset, to the output stream.write(String str): This method writes the characters of the specifiedstrstring to the output stream.write(String str, int off, int len): This method writes up tolencharacters from the specifiedstrstring, starting at the specifiedoffoffset, to the output stream.flush(): This method flushes the output stream, meaning that any buffered characters are written to their intended destination.close(): This method closes the output stream and releases any system resources associated with it.getEncoding(): This method returns the name of the character set being used by thisOutputStreamWriter.
