...... DataInputStream istrm = conn.opendatainputstream (); byte imagedata [];
// If the picture size IF (Length! = -1) {imagedata = new byte [length];
// Read image data to imagedata array istrm.readfully (imagedata);
// Picture size is unknown} else {byterrayoutputstream bstrm = new byterrayoutputstream (); int Ch; while ((ch = istrm.read ())! = -1) BSTRM.WRITE (CH); imagedata = BSTRM.TOBYTEARRAY (); Bstrm.close ();
// Create a picture image = image.createImage (imagedata, 0, imagedata.length); ......