it.unimi.di.mg4j.index.remote
Class RemoteInputStream
java.lang.Object
java.io.InputStream
it.unimi.di.mg4j.index.remote.RemoteInputStream
- All Implemented Interfaces:
- RepositionableStream, Closeable
public class RemoteInputStream
- extends InputStream
- implements RepositionableStream
A client class that connects to an IndexServer
and exposes a remote InputStream
locally.
- Author:
- Alessandro Arrabito
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RemoteInputStream
public RemoteInputStream(SocketAddress address,
byte serverCommand)
throws IOException
- Creates a new client input stream using a given socket address.
- Parameters:
address
- the address of the index server.
- Throws:
IOException
RemoteInputStream
public RemoteInputStream(SocketAddress address)
throws IOException
- Throws:
IOException
available
public int available()
throws IOException
- Overrides:
available
in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
read
public int read(byte[] array,
int offset,
int length)
throws IOException
- Overrides:
read
in class InputStream
- Throws:
IOException
skip
public long skip(long toSkip)
throws IOException
- Overrides:
skip
in class InputStream
- Throws:
IOException
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
IOException
position
public void position(long newPosition)
throws IOException
- Specified by:
position
in interface RepositionableStream
- Throws:
IOException
position
public long position()
throws IOException
- Specified by:
position
in interface RepositionableStream
- Throws:
IOException