package cs.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
public class StreamTools {
public static byte[] read(InputStream inStream) throws IOException{
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
byte [] buffer = new byte[1024];
int len = 0;
while((len=inStream.read(buffer))!=-1){
outStream.write(buffer);
}
inStream.close();
outStream.close();
return outStream.toByteArray();
}
}
package cs.service;
import java.io.IOException