|
Last change
on this file was 29681, checked in by donvip, 13 years ago |
|
[josm_opendata] .7z archive read support: remove unused code
|
|
File size:
1006 bytes
|
| Line | |
|---|
| 1 | package org.j7zip.SevenZip;
|
|---|
| 2 |
|
|---|
| 3 | public class MyRandomAccessFile extends org.j7zip.SevenZip.IInStream {
|
|---|
| 4 |
|
|---|
| 5 | java.io.RandomAccessFile _file;
|
|---|
| 6 |
|
|---|
| 7 | public MyRandomAccessFile(String filename,String mode) throws java.io.IOException {
|
|---|
| 8 | _file = new java.io.RandomAccessFile(filename,mode);
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | public long Seek(long offset, int seekOrigin) throws java.io.IOException {
|
|---|
| 12 | if (seekOrigin == STREAM_SEEK_SET) {
|
|---|
| 13 | _file.seek(offset);
|
|---|
| 14 | }
|
|---|
| 15 | else if (seekOrigin == STREAM_SEEK_CUR) {
|
|---|
| 16 | _file.seek(offset + _file.getFilePointer());
|
|---|
| 17 | }
|
|---|
| 18 | return _file.getFilePointer();
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | public int read() throws java.io.IOException {
|
|---|
| 22 | return _file.read();
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | public int read(byte [] data, int off, int size) throws java.io.IOException {
|
|---|
| 26 | return _file.read(data,off,size);
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | public void close() throws java.io.IOException {
|
|---|
| 30 | _file.close();
|
|---|
| 31 | _file = null;
|
|---|
| 32 | }
|
|---|
| 33 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.