public void write(int b)
Writes the specified byte to this stream. If the byte is a newline and automatic flushing is enabled then the flush method will be invoked.
Note that the byte is written as given; to write a character that will be translated according to the platform's default character encoding, use the print(char) or println(char) methods
By the way just curious to know why the character is assigned to int datatype?