Add method to convert string to input stream

and its unit test.
Fix method name to comply with Java standards