public static byte[] read(InputStream inStream) throws Exception
{
ByteArrayOutputStream outputStream=new ByteArrayOutputStream();//创建缓存将读到的信息放到缓存中
byte[] buffer=new byte[1024];
int length=0;
while((length=inStream.read(buffer))!=-1)
{
outputStream.write(buffer, 0, buffer.length);
}
inStream.close();
return outputStream.toByteArray();
}