posted 25 years ago
Here's something that irritates me every time I bump into it. I wonder if anyone here has a good solution.
I want to copy all the data, completely untranslated, from somewhere to somewhere else. For example, serving a file to a client over a socket.
It seems that if I use Streams, it works fine, but if I try and use Readers/Writers, some sort of wierd translation takes place.
To demonstrate the problem, compile the following simple application and run it with the path to a GIF file as an argument. It will produce two files in the current directory (stream.gif and reader.gif). These files all have the same size (on my system at least), but if you try and open them with a browser or editor, only the original and stream.gif seem to be valid.
I can't find any way of stopping the Reader/Writer version changing my data. Help!
For the moment, I have converted over to using exclusively Stream classes, but at the expense of loads of "deprecated" warnings, and some irritating interfaces.
I would really like to find out what's going on here, so I can move to using Reader/Writer properly. Any suggestions?
[This message has been edited by Frank Carver (edited December 15, 1999).]