Its most likely deprecated due to encoding issues. You could also turn the
string into a byte array and use a byte array input stream or use the
stringreader in lieu of the string.. The issue still is "are you sure you
want an input stream which doesn't handle encoding???"
-andy
On 5/31/03 12:57 PM, "Richard O. Hammer" <[EMAIL PROTECTED]> wrote:
> I am trying to get an InputStream from a String. Can somebody tell me
> the easy way?
>
> In my SDK 1.4.0, I notice java.io.StringBufferInputStream. That would
> help but it is deprecated. The Javadoc for that class says I can get
> my stream from a string "via the StringReader class", but I have not
> seen an easy way.
>
> Maybe they mean I am supposed to do something like this:
>
> import java.io.*;
>
> class StringInputStream extends InputStream{
>
> StringReader stringReader;
>
> StringInputStream(String inString){
> stringReader = new StringReader(inString, "ASCII");
> }
>
> public int read() throws IOException{
> return stringReader.read();
> }
> }
>
> What do you think? Is that what I need to do? Or is there a more
> direct way in the API which I have not discovered?
>
> Thank you,
> Rich Hammer
>
>
> _______________________________________________
> Juglist mailing list
> [EMAIL PROTECTED]
> http://trijug.org/mailman/listinfo/juglist_trijug.org
--
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI
http://jakarta.apache.org/poi
For Java and Excel, Got POI?
_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org