How to process both binary and text in a stream at once?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Milos_Kleint
Posted On:   Thursday, April 19, 2001 06:12 AM

Hello.

While implementing the cvs pserver protocol, we've come across this problem.
CVS sends data in one stream, the protocol commands are all in text mode, being read line by line.
(this needs to be correctly encoded since filenames/descriptions/ect can be in Japanese for example.)
Then one of the commands tells the client to read xxx bytes off the stream as binary data.
After that the client is supposed to read in text format again.
How to do that when InputStreams are there for reading binary data and Readers for reading text data?

Thanks a lot.

Milos Kleint

Re: How to process both binary and text in a stream at once?

Posted By:   Michael_Wax  
Posted On:   Saturday, April 21, 2001 05:12 PM

What about using a DataInputStream? This lets you read in bytes from a binary stream as any of the Java data types (byte, char, String).
About | Sitemap | Contact