`
文章列表
import java.io.FileInputStream; import java.io.FileOutputStream; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.nio.charset.Charset; /** * * convert text to and from ByteBuffer * */ public class Buffer2Text { private static final int BSIZE = 1024; ...
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; /** * * 使用Channel和Buffer拷贝文件 * */ public class ChannelCopy { private static final int BSIZE = 1024; public static void ...
import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; /** * * 从流中获得通道 * FileInputStream, FileOutputStream, RandomAccessFile * */ public cla ...
public class OSExecuteException extends RuntimeException { private static final long serialVersionUID = 5901555192879431127L; public OSExecuteException(String msg){ super(msg); } } ----------------------- import java.io.BufferedReader; import java.io.InputStreamReader; / ...
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; ...
import java.io.PrintWriter; /** * * 改写标准输出 * */ public class ChangeSysOut { public static void main(String[] args) { //PrintWriter构造的第二个参数如果为false,如果不调用close/flush方法将无法看到输出 PrintWriter out = new PrintWriter(System.out,true); for(int i=0;i<10;i++){ out.println("a ...

[java][io]标准IO

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * * 将标准输入的字符转成大写后输出到标准输出,并回到程序 * */ public class Echo { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamRead ...
import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; /** * 读取二进制文件 */ public class BinaryFile { public static byte[] read(File bFile){ FileInputStream fin; try { fin = new FileInputStream(bFile); Buffere ...
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.TreeSet; public class TextFile extends Arra ...
import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.regex.Pattern; public final class DirUtil { //produce a sequence of File objects that match a regular expression in a local directory p ...
import java.io.File; import java.io.FilenameFilter; import java.util.Arrays; import java.util.regex.Pattern; public class DirList { /** * @param args */ public static void main(String[] args) { File path = new File("d:/"); String[] list; if(args.length==0){ ...
import java.util.StringTokenizer; import org.junit.Test; public class MyTest { String str = "A4b54e85a96sd5sddd113"; @Test public void tstDigit(){ StringBuilder sb = new StringBuilder(str); int len = sb.length(); for(int i=0;i<len;i++){ char ch = ...
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=com.yourcom -DartifactId=mvndemo -Dversion=1.0-SNAPSHOT mvn -Dwtpversion=1.0 eclipse:eclipse
eclipse自动补全设置:   window-->preferences-->general-->keys-->Content Assist   修改binding=Alt + /       when=editing text eclipse集成maven后,启动时遇到Unable to update index for central http://repo1.maven.org/maven2/ 错误:   window-->preferences-->maven   去掉download repository index updates on sta ...
在pom.xml文件中的<plugins>中加入: <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>${jetty.version}</version> <configuration> <contextPath ...
Global site tag (gtag.js) - Google Analytics