Package org.lionsoul.ip2region.xdb
Class Searcher
java.lang.Object
org.lionsoul.ip2region.xdb.Searcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionSearcher(Version version, File xdbFile, byte[] vectorIndex, LongByteArray cBuff) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intstatic LongByteArrayloadContent(RandomAccessFile handle) static LongByteArrayloadContentFromFile(File xdbFile) static LongByteArrayloadContentFromFile(String xdbPath) static LongByteArraystatic HeaderloadHeader(RandomAccessFile handle) static HeaderloadHeaderFromBuffer(LongByteArray cBuffer) static HeaderloadHeaderFromFile(File xdbFile) static HeaderloadHeaderFromFile(String xdbPath) static byte[]loadVectorIndex(RandomAccessFile handle) static byte[]loadVectorIndexFromBuffer(LongByteArray cBuffer) static byte[]loadVectorIndexFromFile(File xdbFile) static byte[]loadVectorIndexFromFile(String xdbPath) static SearchernewWithBuffer(Version version, LongByteArray cBuff) static SearchernewWithFileOnly(Version version, File xdbFile) static SearchernewWithFileOnly(Version version, String xdbPath) static SearchernewWithVectorIndex(Version version, File xdbFile, byte[] vectorIndex) static SearchernewWithVectorIndex(Version version, String xdbPath, byte[] vectorIndex) protected voidread(long offset, byte[] buffer) search(byte[] ip) toString()static voidverify(RandomAccessFile handle) static voidstatic voidverifyFromFile(File xdbFile) static voidverifyFromFile(String xdbPath)
-
Field Details
-
STRUCTURE_20
public static final int STRUCTURE_20- See Also:
-
STRUCTURE_30
public static final int STRUCTURE_30- See Also:
-
HeaderInfoLength
public static final int HeaderInfoLength- See Also:
-
VectorIndexRows
public static final int VectorIndexRows- See Also:
-
VectorIndexCols
public static final int VectorIndexCols- See Also:
-
VectorIndexSize
public static final int VectorIndexSize- See Also:
-
MAX_WRITE_BYTES
public static final int MAX_WRITE_BYTES- See Also:
-
-
Constructor Details
-
Searcher
public Searcher(Version version, File xdbFile, byte[] vectorIndex, LongByteArray cBuff) throws IOException - Throws:
IOException
-
-
Method Details
-
newWithFileOnly
- Throws:
IOException
-
newWithFileOnly
- Throws:
IOException
-
newWithVectorIndex
public static Searcher newWithVectorIndex(Version version, String xdbPath, byte[] vectorIndex) throws IOException - Throws:
IOException
-
newWithVectorIndex
public static Searcher newWithVectorIndex(Version version, File xdbFile, byte[] vectorIndex) throws IOException - Throws:
IOException
-
newWithBuffer
- Throws:
IOException
-
close
- Throws:
IOException
-
getIPVersion
-
getIOCount
public int getIOCount() -
search
- Throws:
Exception
-
search
- Throws:
IOExceptionInetAddressException
-
read
- Throws:
IOException
-
toString
-
loadHeader
- Throws:
IOException
-
loadHeaderFromFile
- Throws:
IOException
-
loadHeaderFromFile
- Throws:
IOException
-
loadHeaderFromBuffer
- Throws:
IOException
-
loadVectorIndex
- Throws:
IOException
-
loadVectorIndexFromFile
- Throws:
IOException
-
loadVectorIndexFromFile
- Throws:
IOException
-
loadVectorIndexFromBuffer
- Throws:
IOException
-
loadContent
- Throws:
IOException
-
loadContentFromFile
- Throws:
IOException
-
loadContentFromFile
- Throws:
IOException
-
loadContentFromInputStream
- Throws:
IOException
-
verify
- Throws:
IOExceptionXdbException
-
verify
- Throws:
IOExceptionXdbException
-
verifyFromFile
- Throws:
IOExceptionXdbException
-
verifyFromFile
- Throws:
IOExceptionXdbException
-