|
|
@ -112,12 +112,12 @@ public class Base64Command extends AnnotatedCommand {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
InputStream input = null;
|
|
|
|
InputStream input = null;
|
|
|
|
|
|
|
|
ByteBuf convertResult = null;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
input = new FileInputStream(f);
|
|
|
|
input = new FileInputStream(f);
|
|
|
|
byte[] bytes = IOUtils.getBytes(input);
|
|
|
|
byte[] bytes = IOUtils.getBytes(input);
|
|
|
|
|
|
|
|
|
|
|
|
ByteBuf convertResult = null;
|
|
|
|
|
|
|
|
if (this.decode) {
|
|
|
|
if (this.decode) {
|
|
|
|
convertResult = Base64.decode(Unpooled.wrappedBuffer(bytes));
|
|
|
|
convertResult = Base64.decode(Unpooled.wrappedBuffer(bytes));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -138,6 +138,9 @@ public class Base64Command extends AnnotatedCommand {
|
|
|
|
process.end(1, "read file error: " + e.getMessage());
|
|
|
|
process.end(1, "read file error: " + e.getMessage());
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
if (convertResult != null) {
|
|
|
|
|
|
|
|
convertResult.release();
|
|
|
|
|
|
|
|
}
|
|
|
|
IOUtils.close(input);
|
|
|
|
IOUtils.close(input);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|