class IndexedFidReader implements FIDReader, FileReader {

    public long findFid(String fid) throws IOException {
        try {
            int idx = typeName.length(); //typeName already contains the trailing "."
            long desired = -1;
            if(fid.startsWith(typeName)){
                try{
                    desired =  Long.parseLong(fid.substring(idx), 10);
                }catch(NumberFormatException e){
                    return -1;
                }
            }else{
                return -1;
            }

            if ((desired < 0)) {
                return -1;
            }

            if (desired < count) {
                return search(desired, -1, this.count, desired - 1);
            } else {
                return search(desired, -1, this.count, count - 1);
            }
        } catch (NumberFormatException e) {
            LOGGER
                    .warning("Fid is not recognized as a fid for this shapefile: "
                            + typeName);
            return -1;
        }
    }

    public  IndexedFidReader(ShpFiles shpFiles);
    public  IndexedFidReader( ShpFiles shpFiles, ReadableByteChannel in );

}