Re: Streams question
- From: Chris Smith <cdsmith@xxxxxxx>
- Date: Fri, 28 Oct 2005 23:35:27 -0600
Roedy Green <my_email_is_posted_on_my_website@xxxxxxxxxxxxxx> wrote:
> >Is there a difference between these pieces of code?
>
> have you tried executing them? I think you will fined fileStream is
> already closed.
Let me stick my nose in here. In situations like this, testing is NOT
the right thing to do. There are two reasons for this: (a) the result
is not directly observable, so the test is likely to be inconclusive or
just result in guesses; and (b) there is potentially indeterminate
behavior involved (namely, with the finalizer of the nested stream, if
the outer stream were to discard it but not close it).
Learning by testing is best done when you can write tests that clearly
select between possible results, and where you can trust the results to
be reliable.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
.
- Follow-Ups:
- Re: Streams question
- From: Roedy Green
- Re: Streams question
- References:
- Streams question
- From: Brian Fox
- Streams question
- Prev by Date: Re: How to hide information from address line of JSP?
- Next by Date: Re: Help with Java
- Previous by thread: Streams question
- Next by thread: Re: Streams question
- Index(es):