Title: RE: [jdjlist] RE: ByteArrayInputStream vs ByteArrayOutputStream
maybe this example will help <from Java Collection that I started to read>
What you type in as input params will be printed back out which demonstrates it thru. Serialized vector.
 
--start--
//SerialVector.java
//
import java.io.*;
import java.util.*;
public class SerialVector {
   
    public static void main (String args[]) throws Exception {
        Vector v = new Vector(Arrays.asList(args));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream    oos  = new ObjectOutputStream(baos);
        oos.writeObject(v);
        oos.close();
        //
        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        ObjectInputStream    ois  = new ObjectInputStream(bais);
        Vector v2 = (Vector)ois.readObject();
        Enumeration e=v2.elements();
        while (e.hasMoreElements()){
            System.out.println(e.nextElement());
        }
    }
 
--end
 
Paul
-----Original Message-----
From: Greg Nudelman [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 25, 2002 4:16 PM
To: JDJList
Subject: [jdjlist] RE: ByteArrayInputStream vs ByteArrayOutputStream

Thanks! I prefer "Super Geek", but GEEK (all capitals) is OK too.

:->

Happy Friday to all!

Greg

-----Original Message-----
From: Clark, Gary [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 25, 2002 12:57 PM
To: JDJList
Subject: [jdjlist] RE: ByteArrayInputStream vs ByteArrayOutputStream


GEEKS!

-----Original Message-----
From: Greg Nudelman [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 25, 2002 2:44 PM
To: JDJList
Subject: [jdjlist] RE: ByteArrayInputStream vs ByteArrayOutputStream



>to create the actual "flow" you still need something in the middle ot turn
on the shower and to flush the toilet periodically.

Good point -- now the analogy is complete! hehehehe

Greg

-----Original Message-----
From: W. Nathaniel Mills, III [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
Sent: Friday, October 25, 2002 12:37 PM
To: JDJList
Subject: [jdjlist] RE: ByteArrayInputStream vs ByteArrayOutputStream


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

Friday, October 25, 2002 1:48 PM
To: "JDJList" <[EMAIL PROTECTED]>
cc:
From: Greg Nudelman <[EMAIL PROTECTED]>
Subject: [jdjlist] RE: ByteArrayInputStream vs ByteArrayOutputStream


OK, but this make very little sense to me.  These io classes are like pipes
in your house. Why assign the shower to the toilet?

Can you tell us what you want to do?
Greg


____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm <http://www.sys-con.com/java/list.cfm>


Be respectful! Clean up your posts before replying
____________________________________________________

____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________


____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________
____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to