java byte配列のコピー

FileInputStream fis=null;
  try {
   fis = new FileInputStream(fileName);
 
   int count = 0;
   int len;
   byte [] src = new byte[1024];
   try {

 while ((len = fis.read(dst, count, len )) != 0) {  // 読み込み
  count+=len;
 }
   } catch (IOException e) {
    e.printStackTrace();
   }
  } catch (FileNotFoundException e) {
   e.printStackTrace();
  }finally{
   try {
    if(fis != null) {
     fis.close();
    }
   } catch (IOException e) {
    e.printStackTrace();
   }
  }

コメント / トラックバック1件

  1. Tuesday より:

    You keep it up now, undersnatd? Really good to know.

コメントをどうぞ