Added methods for writing to streams in the Writer.java class.