*/
public static Index getIndex( final String host, final int port, final boolean randomAccess, final boolean documentSizes ) throws IOException, ClassNotFoundException {
final Socket socket = new Socket( host, port == -1 ? DEFAULT_PORT : port );
LOGGER.debug( "Accessing remote index at " + host + ":" + port + "..." );
final DataOutputStream outputStream = new DataOutputStream( socket.getOutputStream() );
outputStream.writeByte( GET_INDEX );
outputStream.writeBoolean( randomAccess );
outputStream.writeBoolean( documentSizes );
outputStream.flush();
Index index = (Index)BinIO.loadObject( socket.getInputStream() );
socket.close();