Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes String to InputStream ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String to InputStream ?" Watch "String to InputStream ?" New topic

String to InputStream ?

justin wall

Joined: Jul 30, 2001
Posts: 8
I'm using a package call Zql to parse an SQL statement and derive the tables, columns, etc. from it. The parser in Zql is expecting an InputStream and my SQL is in a String variable. Is there a way to convert a String to an InputStream in order to use this package?
Justin Wall
Aaron Webb

Joined: Aug 16, 2001
Posts: 17
String test = "This is a test";
InputStream is = new ByteArrayInputStream(test.getBytes());
I agree. Here's the link:
subject: String to InputStream ?
It's not a secret anymore!