Re: How to remove " from ByteArrayInputStream ?
krislioe@gmail.com wrote:
Hi all,
I have a ByteArrayInputStream , like following :
"D00AH038600ETB000100130000 6 6PCS
215990707024270702524000"
"D00AH038600ETB000100XXXXXX 6 6PCS
215990707024270702524000"
I have two questions, pls help :
1) How to remove " from it ?
You don't remove anything from an input stream directly, you read it. As you
read the data, you process it. Skip over the unwanted characters as you
process the input.
2) The ByteArrayInputStream sent from to client browser (via jsp
page), the question is, why if user display it using NOTEPAD, it does
not separated into 2 (two) lines, but become one long line. ??
Only when I first open it with WordPad it display correctly that save
as txt, then open with Notepad, only then it display correctly.
Where is the client browser?
You have a newline issue - seems that your input is delineated with '\n'
characters. Notepad being the brain-dead thing that it is, only handles
"\r\n" separators correctly. Apparently Wordpad, being the arrogant
know-it-all that it is, decided for you to convert all those standard line
endings into the peculiar Windows variant, thus satisfying Notepad while
corrupting your data.
--
Lew