6 messages in com.mysql.lists.javaRe: streams question
FromSent OnAttachments
Carlos Proal06 Jun 2000 18:30 
Tim Endres06 Jun 2000 18:47 
Terrence W. Zellers06 Jun 2000 20:05 
Carlos Proal06 Jun 2000 21:21 
Youngho Cho07 Jul 2000 03:05 
Frazer Dixon07 Jul 2000 03:14 
Subject:Re: streams question
From:Carlos Proal (pro@hotmail.com)
Date:06/06/2000 09:21:18 PM
List:com.mysql.lists.java

Thanx Tim and Terrence

i have changed my code like this, and now everything works fine thanx for share your knowledge

public static byte[] getImageAsArray(InputStream inputStream) {

ByteArrayOutputStream baos=new ByteArrayOutputStream();

int abyte; while(true) { try { abyte=inputStream.read();

if (abyte== -1) break;

baos.write(abyte); } catch(Exception e1) { break; } }//while

return baos.toByteArray();

}