예제 #1
0
 public long length() {
   try {
     return image.length();
   } catch (IOException e) {
     return -1L;
   }
 }
예제 #2
0
 public int write(byte[] data, int offset, int length) throws IOException {
   image.write(data, offset, length);
   return length;
 }
예제 #3
0
 public void seek(long offset) throws IOException {
   image.seek(offset);
 }
예제 #4
0
 public void close() throws IOException {
   image.close();
 }
예제 #5
0
 public int read(byte[] data, int offset, int length) throws IOException {
   return image.read(data, offset, length);
 }
예제 #6
0
파일: LibRt.java 프로젝트: yamila87/rt_src
 public static FileLock lock_file(String path) throws IOException, FileNotFoundException {
   RandomAccessFile file = new RandomAccessFile(path, "rw");
   FileChannel fileChannel = file.getChannel();
   return fileChannel.tryLock();
 }