Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions com/jcraft/jorbis/VorbisFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public VorbisFile(String file) throws JOrbisException{
super();
InputStream is=null;
try{
is=new SeekableInputStream(file);
is=new SeekableInputStreamImpl(file);
int ret=open(is, null, 0);
if(ret==-1){
throw new JOrbisException("VorbisFile: open return -1");
Expand Down Expand Up @@ -1339,11 +1339,17 @@ public void close() throws java.io.IOException{
datasource.close();
}

class SeekableInputStream extends InputStream{
public static abstract class SeekableInputStream extends InputStream {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main change is that this class is now static and public

public abstract long getLength() throws IOException;
public abstract long tell() throws IOException;
public abstract void seek(long pos) throws IOException;
}

static class SeekableInputStreamImpl extends SeekableInputStream{
java.io.RandomAccessFile raf=null;
final String mode="r";

SeekableInputStream(String file) throws java.io.IOException{
SeekableInputStreamImpl(String file) throws java.io.IOException{
raf=new java.io.RandomAccessFile(file, mode);
}

Expand Down Expand Up @@ -1379,16 +1385,6 @@ public void close() throws java.io.IOException{
raf.close();
}

public synchronized void mark(int m){
}

public synchronized void reset() throws java.io.IOException{
}

public boolean markSupported(){
return false;
}

Comment on lines -1382 to -1391
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, no functionality added compared to base class

public void seek(long pos) throws java.io.IOException{
raf.seek(pos);
}
Expand Down