🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #1135

println, print?!

#1135
From: jam
Date: Thu, 20 May 1999 00:00
26 lines
1339 bytes
Hi, something is really strange with my java program, can anyone pls
help?

At some point of my program, there are the below 2 lines...

     String received = new String(inPL.Msg,0,30);
     System.out.print(received);

Note: inPL.Msg is of type byte[] from a class.
The strange thing is, when I have that in a loop, it doesn't get printed
out if I have it as print, but if i have it as println, it is fine (but
of course I don't want to have a line feed every time!)

In case u need some background of my whole program:
A program with 2 threads, one thread receiving message from a socket,
and the other thread sends out.  The above lines are from my receiving
thread.

Anyone had anything like that happened to them before? if so, how did u
solve it?
Is there anything in java that is kind of like fflush() in C that flush
the stdin/out put??

Thanks heaps

Regards, James.
Technical Details
Message-ID: <37441330.98141F7D@ihug.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,c63335b03a0ce709,start
X-Google-Attributes: gid10d6db,public
From: jam <jho@ihug.com.au>
Subject: println, print?!
Date: 1999/05/20
Message-ID: <37441330.98141F7D@ihug.com.au>
X-Deja-AN: 480128016
Content-Transfer-Encoding: 7bit
Organization: The Internet Group Ltd
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: aus.computers.java