1 32 package com.imagero.uio; 33 34 import java.io.EOFException ; 35 import java.io.IOException ; 36 import java.io.RandomAccessFile ; 37 38 47 public class RandomAccessFileWrapperRO extends AbstractRandomAccessRO { 48 protected RandomAccessFile in; 49 50 protected int _read() throws IOException { 51 int i = in.read(); 52 if(i < 0) { 53 throw new EOFException (); 54 } 55 return i; 56 } 57 58 public RandomAccessFileWrapperRO(RandomAccessFile in, int byteOrder) throws IOException { 59 this.in = in; 60 _setByteOrder(byteOrder); 61 } 62 63 public int skip(int n) throws IOException { 64 return skipBytes(n); 65 } 66 67 71 public int read() throws IOException { 72 return in.read(); 73 } 74 75 public int read(byte b[], int off, int len) throws IOException { 76 return in.read(b, off, len); 77 } 78 79 public int read(byte b[]) throws IOException { 80 return in.read(b); 81 } 82 83 public long getFilePointer() throws IOException { 84 return in.getFilePointer(); 85 } 86 87 public void seek(long pos) throws IOException { 88 in.seek(pos); 89 } 90 91 public long length() throws IOException { 92 return in.length(); 93 } 94 95 public void close() throws IOException { 96 in.close(); 97 } 98 } 99 | Popular Tags |