Java ʵÏÖÎļþ·Ö¸îºÏ²¢µÄ´úÂë
import java.io.*;
class Fen{
String fileName;
int size;
Fen(String fileName,String size){
this.fileName = fileName;
this.size = Integer.parseInt(size)*1024;
}
public void cut()throws Exception{
int maxx = 0;
File inFile = new File(fileName);
int fileLength = (int)inFile.length(); //È¡µÃÎļþµÄ´óС
int value; //È¡µÃÒª·Ö¸îµÄ¸öÊý
RandomAccessFile inn = new RandomAccessFile(inFile,"r");//´ò¿ªÒª·Ö¸îµÄÎļþ
value = fileLength/size;
int i=0;
int j=0;
//¸ù¾ÝÒª·Ö¸îµÄÊýÄ¿Êä³öÎļþ
for (;j File outFile = new File(inFile.getName()+j+"zzii");
RandomAccessFile outt= new RandomAccessFile(outFile,"rw");
maxx+=size;
for (;i outt.write(inn.read());
}
outt.close();
}
File outFile = new File(inFile.getName()+j+"zzii");
RandomAccessFile outt= new RandomAccessFile(outFile,"rw");
for(;i
outt.write(inn.read());
}
outt.close();
inn.close();
}
}
class He{
String fileName;
String filterName;
He(String fileName,String filterName){
this.fileName = fileName;
this.filterName = filterName;
}
public void unite()throws Exception{
String [] tt;
File inFile = new File("."); //ÔÚµ±Ç°Ä¿Â¼ÏµÄÎļþ
File outFile = new File(fileName); //È¡µÃÊä³öÃû
RandomAccessFile outt= new RandomAccessFile(outFile,"rw");
//È¡µÃ·ûºÏÌõ¼þµÄÎļþÃû
tt = inFile.list(new FilenameFilter(){
public boolean accept(File dir,String name){
String rr = new File(name).toString();
return rr.endsWith(filterName);
}
});
//´òÓ¡³öÈ¡µÃµÄÎļþÃû
for (int i = 0;i System.out.println(tt[i]);
}
//´ò¿ªËùÓеÄÎļþÔÙдÈëµ½Ò»¸öÎļþÀï
for(int i=0;i inFile = new File(tt[i]);
RandomAccessFile inn= new RandomAccessFile(inFile,"r");
int c;
while((c=inn.read())!=-1)
outt.write(c);
}
outt.close();
}
}
public class test{
public static void main(final String [] args)throws Exception{
if(args.length==0){
print();
return;
}
if(args[0].equals("-c")){
Fen cutt = new Fen(args[1],args[2]);
cutt.cut();
}
else if (args[0].equals("-r")){
He hee = new He(args[1],args[2]);
hee.unite();
}
else
Ïà¹ØÎĵµ£º
----------------------------------------------------
±¾ÎÄת×Ô£º
http://blog.sina.com.cn/s/blog_477daa680100hf1q.html
¸Ðл×÷Õß
----------------------------------------------------
¹æÂÉÊÇÕâÑùµÄ£º
ÈκÎÒ»¸öÀ࣬ÔÚÖ´ÐÐÒ»¸ö·½·¨Ç°±ØÐëÒªÏÈ°²´úÂëµÄ˳Ðò³õʼ»¯ËùÓеľ²Ì¬¿é£¬È»ºóµ÷ÓÃmainº¯Êý£¬
ÔÚÉú³ÉÒ»¸ö ......
Java¶Ô¶ÔÏóºÍ»ù±¾µÄÊý¾ÝÀàÐ͵Ĵ¦ÀíÊDz»Ò»ÑùµÄ¡£¶Ô»ù±¾µÄÊý¾ÝÀàÐÍÀàËÆÓÚC/C++Öеķ½·¨£¨Öµ´«µÝ£©¡£ÔÚJavaÖÐÓöÔÏóµÄ×÷ΪÈë¿Ú²ÎÊýµÄ´«µÝÔòȱʡΪ"ÒýÓô«µÝ"£¬Ò²¾ÍÊÇ˵½ö½ö´«µÝÁ˶ÔÏóµÄÒ»¸ö"ÒýÓÃ"£¬Õâ¸ö"ÒýÓÃ"µÄ¸ÅÄîͬCÓïÑÔÖеÄÖ¸ÕëÒýÓÃÊÇÒ»ÑùµÄ¡£µ±º¯ÊýÌåÄÚ²¿¶ÔÊäÈë±äÁ¿¸Ä±äʱ£¬ÊµÖÊÉϾÍÊÇÔÚ¶Ô ......
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......
Ò»¡¢Java²¿·Ö£¨¹²40·Ö£©
1¡¢ ˵˵OverloadºÍOverrideµÄÇø±ð¡£OverloadedµÄ·½·¨ÊÇ·ñ¿ÉÒԸı䷵»ØÖµµÄÀàÐÍ£¿£¨5·Ö£©
OverloadÊǸ²¸Ç£¬×ÓÀàµÄ·½·¨¸ú¸¸Àà·½·¨Ãû×ÖÒ»Ñù£¬×ÓÀàµÄ·½·¨°Ñ¸¸ÀàµÄ¸²¸ÇÁË¡£
OverrideÊÇÖØÔØ£¬²»Í¬µÄ·½·¨²ÎÊý¡¢·µ»ØÖµ²»Ò»Ñù£¬½ô½ô·µ»ØÖµ²»Ò»ÑùµÄÁ½¸öº¯Êý²»½ÐÖØÔØ£¬±àÒë²»»áͨ¹ýµÄ¡£
Over ......
JAVA String¶ÔÏóºÍ×Ö·û´®³£Á¿µÄ¹Øϵ½âÎö
1 ×Ö·û´®ÄÚ²¿Áбí
JAVAÖÐËùÓеĶÔÏ󶼴æ·ÅÔÚ¶ÑÀïÃ棬°üÀ¨String¶ÔÏó¡£×Ö·û´®³£Á¿±£´æÔÚJAVAµÄ.classÎļþµÄ³£Á¿³ØÖУ¬ÔÚ±àÒëÆÚ¾ÍÈ·¶¨ºÃÁË¡£
ÐéÄâ»úΪÿ¸ö±»×°ÔصÄÀàÐÍά»¤Ò»¸ö³£Á¿³Ø¡£³£Á¿³Ø¾ÍÊǸÃÀàÐÍËùÓó£Á¿µÄÒ»¸öÓÐÐò¼¯ºÏ£¬°üÀ¨Ö±½Ó³£Á¿(string¡¢integerºÍfloat point³ ......