An input string stream is a Scanner object initialized from a String. An output string stream can be created by using the StringWriter and PrintWriter class. StringWriter class provides a character stream for outputting characters. PrintWriter class is a wrapper class for outputting various data types to the character stream, similarly to System.out. The toString() method copies a buffer to a String