Here you can find the source of getStream(String string, String codePage)
public static InputStream getStream(String string, String codePage) throws UnsupportedEncodingException
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; public class Main { public static InputStream getStream(String string, String codePage) throws UnsupportedEncodingException { return new ByteArrayInputStream(string.getBytes(codePage)); }//from ww w.j a v a2 s.co m }