The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Writting to a file

Posted by Biswajit on January 09, 2001 at 4:17 AM

InputStream is = (InputStream)o;
int c;
FileOutputStream fw = new FileOutputStream("sanu.txt");
do {
c = is.read();// is is an InputStream object
if ( c != -1 )
{
fw.write( c );
}
} while( c != -1 );
fw.close();

But when I am opening sanu.txt I am getting junc character for newline character.It is not in the format as original.NewLine character are not coming.





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us