org.archive.io
Class SafeSeekInputStream
java.lang.Object
java.io.InputStream
org.archive.io.SeekInputStream
org.archive.io.SafeSeekInputStream
- All Implemented Interfaces:
- it.unimi.dsi.fastutil.io.RepositionableStream, java.io.Closeable
public class SafeSeekInputStream
- extends SeekInputStream
Enables multiple concurrent streams based on the same underlying stream.
- Author:
- pjack
Methods inherited from class java.io.InputStream |
available, close |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SafeSeekInputStream
public SafeSeekInputStream(SeekInputStream input)
throws java.io.IOException
- Constructor. The given stream will be positioned to 0 so that an
accurate position can be tracked.
- Parameters:
input
- the underlying input stream
- Throws:
java.io.IOException
- if an IO error occurs
read
public int read()
throws java.io.IOException
- Specified by:
read
in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] buf,
int ofs,
int len)
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] buf)
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
- Throws:
java.io.IOException
skip
public long skip(long c)
throws java.io.IOException
- Overrides:
skip
in class java.io.InputStream
- Throws:
java.io.IOException
position
public void position(long p)
throws java.io.IOException
- Throws:
java.io.IOException
position
public long position()
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2003-2011 Internet Archive. All Rights Reserved.