public static byte[] convertToByteArray(final InputStream is, int length, boolean close) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
write(out, is, length, close);
out.close();
return out.toByteArray();
}
public static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length) throws IOException {
return write(out, is, l_buffer, length, true);
}