public InputStream string2InputStream(String str) throws UnsupportedEncodingException...{
ByteArrayInputStream bais = new ByteArrayInputStream(str.getBytes());
return bais;
}
public String inputStream2String(InputStream is) throws IOException...{
byte[] buffer = new byte[is.available()];
is.read(buffer);
return new String(buffer);
}
沒有留言:
張貼留言