
Signature
Knute Johnson
email s/nospam/knute/
These are not buffered, so using a BufferedStream may be useful if
doing a large amount of I/O.
(Note, when creating an ObjectOutputStream:
"callers may wish to flush the stream immediately to ensure that
constructors for receiving ObjectInputStreams will not block when
reading the header.")
(In certain edge cases, you may want to flush the ObjectOutputStream,
see
On Feb 18, 5:02 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
> Are ObjectInputStream and ObjectOutputStream buffered? Normally if you
> use a BufferedInputStream it is the last stream class in the list. Can
[quoted text clipped - 7 lines]
> Knute Johnson
> email s/nospam/knute/
Knute Johnson - 18 Feb 2007 23:55 GMT
> These are not buffered, so using a BufferedStream may be useful if
> doing a large amount of I/O.
[quoted text clipped - 20 lines]
>> Knute Johnson
>> email s/nospam/knute/
I tried it with a file and it does improve the I/O considerable but
where I really wanted to use it was with some network I/O. When the
input side was buffered it didn't read all of the data and hung. That
turns out not to be where my problem was anyway so I put it back to
unbuffered. Thanks for the post.

Signature
Knute Johnson
email s/nospam/knute/
Esmond Pitt - 19 Feb 2007 00:47 GMT
> I tried it with a file and it does improve the I/O considerable but
> where I really wanted to use it was with some network I/O. When the
> input side was buffered it didn't read all of the data and hung. That
> turns out not to be where my problem was anyway so I put it back to
> unbuffered.
Buffering on a network is still a good idea. The problem you had was
that the other end wasn't flushing at the appropriate times.
petersprc - 19 Feb 2007 01:51 GMT
Yeah, as Esmond says, the issue seems to be the case considered in
this report:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4337145
Flushing after creating the ObjectOutputStream might do the trick.
On Feb 18, 7:47 pm, Esmond Pitt <esmond.p...@nospam.bigpond.com>
wrote:
> > I tried it with a file and it does improve the I/O considerable but
> > where I really wanted to use it was with some network I/O. When the
[quoted text clipped - 4 lines]
> Buffering on a network is still a good idea. The problem you had was
> that the other end wasn't flushing at the appropriate times.
Knute Johnson - 19 Feb 2007 02:39 GMT
> Yeah, as Esmond says, the issue seems to be the case considered in
> this report:
[quoted text clipped - 12 lines]
>> Buffering on a network is still a good idea. The problem you had was
>> that the other end wasn't flushing at the appropriate times.
That could have been the problem, I'll have to play with is some more.
Thanks,

Signature
Knute Johnson
email s/nospam/knute/