Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String to InputStream ?

 
justin wall
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Thanks,
Justin Wall
 
Aaron Webb
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String test = "This is a test";
InputStream is = new ByteArrayInputStream(test.getBytes());
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic