// Demonstrate ByteArrayOutputStream.import java.io *;. Class ByteArrayOutputStreamDemo {public static void main (String [] args) throws IOException {ByteArrayOutputStream f = new ByteArrayOutputStream (); String s = "This should end up in the array"; byte BUF [] = s.getbytes ();
F.Write (BUF); System.out.Println ("Buffer As A String"); System.out.Println (f.tostring ()); System.out.Println ("Into Array); Byte B [] = f.TobyteaRray (); for (int i = 0; i