I can't believe I'm responding to this, but I couldn't resist. What is
needed in this analogy is a bucket that is filled with water from the
shower and dumped into the toilet. When the toilet is full, it flushes
itself.
Continuing on with the lovely shower/toilet theme, the question comes
to mind: Wouldn't a more direct route be easier? System.arraycopy()
would seem to be a more effective way of copying one array to
another... Something like letting the water run into the shower drain.
public static void main(String[] args) {
byte well[] = new byte[1024];
// Presumably, this well is filled with something
ByteArrayInputStream shower = new ByteArrayInputStream(well);
ByteArrayOutputStream toilet = new ByteArrayOutputStream();
byte bucket[] = new byte[128];
int howFull;
while ((howFull = shower.read(bucket, 0, 128)) > 0) {
toilet.write(bucket, 0, howFull);
}
byte septic[] = toilet.toByteArray();
}
Phillip E. DuLion
> Maybe the water is dirty? ;^) Great analogy. What is missing in the
> original question and the response is the concept that to create the
> actual "flow" you still need something in the middle ot turn on the
> shower and to flush the toilet periodically. This is the code he's
> missing to move out of one (input) and into the other (output)...
>
> Best Regards, Nat
____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
Be respectful! Clean up your posts before replying
____________________________________________________