1 29 30 package com.caucho.vfs; 31 32 import java.io.IOException ; 33 import java.io.InputStream ; 34 import java.io.OutputStream ; 35 36 39 abstract public class RandomAccessStream { 40 43 abstract public long getLength() 44 throws IOException ; 45 46 49 abstract public int read(byte []buffer, int offset, int length) 50 throws IOException ; 51 52 55 abstract public int read(long fileOffset, 56 byte []buffer, int offset, int length) 57 throws IOException ; 58 59 62 abstract public void write(byte []buffer, int offset, int length) 63 throws IOException ; 64 65 68 abstract public void write(long fileOffset, 69 byte []buffer, int offset, int length) 70 throws IOException ; 71 72 75 abstract public boolean seek(long position); 76 77 80 abstract public OutputStream getOutputStream() 81 throws IOException ; 82 83 86 abstract public InputStream getInputStream() 87 throws IOException ; 88 89 92 abstract public int read() 93 throws IOException ; 94 95 98 abstract public void write(int b) 99 throws IOException ; 100 101 104 abstract public long getFilePointer() 105 throws IOException ; 106 107 110 public void close() throws IOException 111 { 112 } 113 } 114 | Popular Tags |