GGYU
// ExecutorService 인터페이스 구현객체 Executors 정적메서드를 통해 최대 스레드 개수가 2인 스레드 풀 생성 ExecutorService executorService = Executors.newFixedThreadPool(2); for(int i = 0; i < 10; i++){ Runnable runnable = new Runnable() { @Override public void run() { //스레드에게 시킬 작업 내용 ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executorService; int poolSize = threadPoolExecutor.getPoolSize();//스레드 풀 사이즈 얻기 Stri..
public void subDirList(String source){File dir = new File(source); File[] fileList = dir.listFiles(); try{for(int i = 0 ; i < fileList.length ; i++){File file = fileList[i]; if(file.isFile()){ // 파일이 있다면 파일 이름 출력System.out.println("\t 파일 이름 = " + file.getName());}else if(file.isDirectory()){System.out.println("디렉토리 이름 = " + file.getName()); // 서브디렉토리가 존재하면 재귀적 방법으로 다시 탐색subDirList(file.getCanoni..
try {InputStream a = new FileInputStream("C:\\mytext.txt"); byte[] buffer = new byte[BUFFER_SIZE];while(true){int i = a.read(buffer);System.out.println("hi : " + i);if ( i == -1 ) break;}} catch (FileNotFoundException e) {// TODO Auto-generated catch blocke.printStackTrace();} OutputStream a = new FileOutputStream("C:\\mytext.txt") ;try {String b = "행복하단. 그런 말을 하고 있었으면서.";byte[] c = b.getBytes()..