How to remove " from ByteArrayInputStream ?

K

krislioe

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 ?

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.

Thank you very much,
xtanto
 
L

Lew

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top