code: private void print(String s, OutputStream ostream) throws IOException
     {
        int length = s.length();
        for (int i = 0; i < length; i++)
        {
           char c = s.charAt(i);
           ostream.write(c);
        }
     }
docs: Writes string into stream.
  
  @param s string
  @param ostream stream
  @throws IOException {@link IOException}