[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[Home]
Re: image.jsp problem (WAS: Location of dependent classes...)
If there were some sort of "null" character encoding, that would fix the
problem as well.
Does anyone know if such a thing exists, or how to create one?
----
George
>From: Tim Endres <time@ice.com>
>To: Carsten Heyl <Heyl@nads.de>, George Burns <george_burns@hotmail.com>
>CC: gnujsp@gjt.org
>Subject: Re: image.jsp problem (WAS: Location of dependent classes...)
>Date: Thu, 14 Oct 1999 16:10:28 -0400 (EDT)
>
> > >How did you get this to work correctly?
> >
> > Don't know, it just works for me :-)
> > I take a closer look what writing binary data to a Writer should mean.
>
>We had to remove Writers and Readers from FTP binary transfers
>because they modify the data in ways that are not compatible.
>
>In fact, if you run the program below, you will discover that the IOStream
>aspect of the Reader/Writer classes is broken. The output file will not
>match the input file.
>
>tim.
>Tim Endres - time@ice.com
>ICE Engineering, Inc. - http://www.ice.com/
>"USENET - a slow moving self parody." - Peter Honeyman
>
>--------
>
>
>import java.io.*;
>
>class IOTest
> {
> public static void
> main( String argv[] )
> {
> String inFileName = argv[0];
> String outFileName = argv[1];
>
> try {
> Reader r =
> new InputStreamReader
> ( new FileInputStream( inFileName ) );
>
> Writer w =
> new OutputStreamWriter
> ( new FileOutputStream( outFileName ) );
>
> char[] buf = new char[ 16 * 1024 ];
>
> for ( ; ; )
> {
> int numRead = r.read( buf, 0, buf.length );
> if ( numRead == -1 )
> break;
> w.write( buf, 0, numRead );
> }
>
> r.close();
> w.close();
> }
> catch ( IOException ex )
> {
> ex.printStackTrace();
> }
> }
>
> }
>
>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com