回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
InputStream 复用
//转换
private ByteArrayOutputStream toByteArrayOutputStream(InputStream input) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int len;
while ((len = input.read(buffer)) > -1) {
baos.write(buffer, 0, len);
}
baos.flush();
return baos;
}
//调用
new ByteArrayInputStream(baos.toByteArray())
特殊字符分割
url.split("\\\\"); '\'分割