|
|
|
@@ -1,10 +1,10 @@
|
|
|
|
|
package com.imyeyu.io;
|
|
|
|
|
|
|
|
|
|
import com.imyeyu.java.TimiJava;
|
|
|
|
|
import com.imyeyu.java.bean.ActionException;
|
|
|
|
|
import com.imyeyu.java.bean.Callback;
|
|
|
|
|
import com.imyeyu.java.bean.CallbackArg;
|
|
|
|
|
import com.imyeyu.java.bean.timi.TimiCode;
|
|
|
|
|
import com.imyeyu.java.bean.timi.TimiException;
|
|
|
|
|
import com.imyeyu.java.bean.ResultCode;
|
|
|
|
|
import com.imyeyu.utils.Decoder;
|
|
|
|
|
import com.imyeyu.utils.OS;
|
|
|
|
|
import com.imyeyu.utils.Text;
|
|
|
|
@@ -233,7 +233,7 @@ public class IO implements OS.FileSystem {
|
|
|
|
|
if (file.renameTo(resultFile) && resultFile.exists()) {
|
|
|
|
|
return resultFile;
|
|
|
|
|
}
|
|
|
|
|
throw new TimiException(TimiCode.RESULT_BAD, "rename file fail: from " + file.getAbsolutePath() + ", to " + resultFile.getAbsolutePath());
|
|
|
|
|
throw new ActionException(ResultCode.RESULT_BAD, "rename file fail: from " + file.getAbsolutePath() + ", to " + resultFile.getAbsolutePath());
|
|
|
|
|
} else {
|
|
|
|
|
String msg = "Illeagl file name: %s, not allow char: %s";
|
|
|
|
|
if (OS.IS_WINDOWS) {
|
|
|
|
@@ -661,7 +661,7 @@ public class IO implements OS.FileSystem {
|
|
|
|
|
public static void toOutputStream(InputStream is, OutputStream os, long start, long end) throws IOException {
|
|
|
|
|
long skip = is.skip(start);
|
|
|
|
|
if (skip != start) {
|
|
|
|
|
throw new TimiException(TimiCode.ERROR, "skip fail");
|
|
|
|
|
throw new ActionException(ResultCode.ERROR, "skip fail");
|
|
|
|
|
}
|
|
|
|
|
byte[] buffer = new byte[8192];
|
|
|
|
|
long remaining = end - start + 1;
|
|
|
|
|