Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

output stream with out.flush HELP NEEDED BAD!

Thread view: 
spidey12345 - 08 Feb 2007 03:35 GMT
PrintWriter out = new PrintWriter(new
FileOutputStream("EncryptedData.txt"));

   out.println("Encrypted text with monoalphabetic subsititution: ");
   out.flush();
   int line = 1;
   for(int i = 0; i<size; i++)
   {

       out.print(newarray[i]);
       out.flush();
       if((i+1)%5==0)
       {
           out.print(" ");

           line = line +1;
       }
       if(line%11 ==0)
       {
       out.println('\n');

       line = line+1;
       }

   }// end for loop

   // frequencies: and it's index of coincidence

   out.println("Frequencies: ");

this is part of my code, simply the when i try to print out the
frequencies words, it won't let me, does it have to do with
out.flush??
any other way to do this
Daniel Pitts - 08 Feb 2007 03:58 GMT
>     PrintWriter out = new PrintWriter(new
> FileOutputStream("EncryptedData.txt"));
[quoted text clipped - 30 lines]
> out.flush??
> any other way to do this

What do you mean it won't let you? Does it give an exception? Does it
not output what you expect?

Its hard for me to tell you whats going on, because your code is out
of context.

Try posting an sscce <http://www.physci.org/codes/sscce/>
This will make it easier for us to help you.

I don't see where you actually try to print out the frequencies, which
is exactly what your asking about.  Thats like telling the doctor you
have a rash on your foot, and only showing him your hands.
spidey12345 - 08 Feb 2007 05:08 GMT
On Feb 7, 10:58 pm, "Daniel Pitts" <googlegrou...@coloraura.com>
wrote:

> >     PrintWriter out = new PrintWriter(new
> > FileOutputStream("EncryptedData.txt"));
[quoted text clipped - 45 lines]
>
> - Show quoted text -

sorry, i got it to work, i was missing a out.flush() after
out.println('frequencies");


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.