|
-
Oct 24th, 2002, 01:44 PM
#1
InputStream/Reader cross operation
I want to decode a Base64 encoded file. I did a Google search and the easiest-to-use library seemed to be two Java classes, so I decided to do my app in Java.
I want to read a Outlook Express 4 mail file, where parts are encoded and others are not. I'm currently reading in the whole file, converting it to a string and searching for encoded blocks. Works great, finds the blocks correctly.
Now my problem: I end up with a String object named base64 which contains the encoded string. The decoding class is derived from FilterInputStream and expects an InputStream object passed to the constructor. But the only InputStream I can see that handles strings is StringInputString which is deprecated and saim the String directlyd to behave incorrectly. You should obviously use StringReader to read from strings.
My question: how can I get some kind of InputStream object, either fro or from StringReader?
For the time being I'll convert the String to a byte array and use a ByteArrayInputStream, but this is notoriously inefficient!
Thx in advance for any help.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|