1 31 package org.pdfbox.io; 32 33 import java.io.File ; 34 import java.io.FileNotFoundException ; 35 import java.io.IOException ; 36 37 44 public class RandomAccessFile implements RandomAccess 45 { 46 private java.io.RandomAccessFile ras; 47 48 55 public RandomAccessFile(File file, String mode) throws FileNotFoundException 56 { 57 ras = new java.io.RandomAccessFile (file, mode); 58 } 59 60 63 public void close() throws IOException 64 { 65 ras.close(); 66 } 67 68 71 public void seek(long position) throws IOException 72 { 73 ras.seek(position); 74 } 75 76 79 public int read() throws IOException 80 { 81 return ras.read(); 82 } 83 84 87 public int read(byte[] b, int offset, int length) throws IOException 88 { 89 return ras.read(b, offset, length); 90 } 91 92 95 public long length() throws IOException 96 { 97 return ras.length(); 98 } 99 100 103 public void write(byte[] b, int offset, int length) throws IOException 104 { 105 ras.write(b, offset, length); 106 } 107 108 111 public void write(int b) throws IOException 112 { 113 ras.write(b); 114 } 115 } | Popular Tags |