Feb
09
Posted on 09-02-2006
Filed Under (Java) by Johan Känngård

Arguments in many methods in the Java APIs are of the type InputStream. This is how to get an InputStream from a String, where argument to getBytes, UTF-8, is the encoding to use:


InputStream is = new ByteArrayInputStream(myString.getBytes(\"UTF-8\"));

[tags]Java[/tags]

(9) Comments    Read More