add use stream method
This commit is contained in:
parent
b7e9755c6b
commit
f3ae83afb5
|
|
@ -23,7 +23,7 @@ namespace IP2Region
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// db file access handler
|
/// db file access handler
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private FileStream _raf = null;
|
private Stream _raf = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// header blocks buffer
|
/// header blocks buffer
|
||||||
|
|
@ -75,6 +75,18 @@ namespace IP2Region
|
||||||
|
|
||||||
public DbSearcher(string dbFile) : this(null, dbFile) { }
|
public DbSearcher(string dbFile) : this(null, dbFile) { }
|
||||||
|
|
||||||
|
public DbSearcher(DbConfig dbConfig, Stream dbFileStream)
|
||||||
|
{
|
||||||
|
if (_dbConfig == null)
|
||||||
|
{
|
||||||
|
_dbConfig = dbConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
_raf = dbFileStream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DbSearcher(Stream dbFileStream) : this(null, dbFileStream) { }
|
||||||
|
|
||||||
#region Sync Methods
|
#region Sync Methods
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the region with a int ip address with memory binary search algorithm.
|
/// Get the region with a int ip address with memory binary search algorithm.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue