public boolean encodeFile(File srcFile,File targetFile)
{
boolean result = false;
InputStream inputStream = null;
OutputStreamWriter outputStreamWriter = null;
OutputStream outputStream = null;
int b = 0;
try {
inputStream = new FileInputStream(srcFile);
outputStream = new FileOutputStream(targetFile);
outputStreamWriter = new OutputStreamWriter(outputStream);
boolean flag = false;
String rr = null;
while(true)
{
b = inputStream.read();
flag = b==-1;
if(flag)
{
break;
}
rr = integerConvert(b, radix);
outputStreamWriter.write(rr);
}
outputStreamWriter.flush();
outputStreamWriter.close();
outputStream.close();
inputStream.close();
result = true;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return result;
}
// public File[] splitFile(File srcFile,long unitByteSize)
// {
// byte[] buffer = new byte[buffSize];
// int num = 0;
// }
public static void main(String[] args) {
File srcFile = new File("D:\\testData\\HTMT\\apache-ant-1.9.4-bin.zip");
File targetFile = new File("D:\\testData\\HTMT\\en");
FileByteConvert fileByteConvert = new FileByteConvert();
// fileByteConvert.encodeFile(srcFile, targetFile);
srcFile = targetFile;
targetFile = new File("D:\\testData\\HTMT\\de.zip");
fileByteConvert.decodingFile(srcFile, targetFile);
}