add use stream method
This commit is contained in:
parent
90f0e86597
commit
d83e20c99c
|
|
@ -23,7 +23,7 @@ namespace IP2Region
|
|||
/// <summary>
|
||||
/// db file access handler
|
||||
/// </summary>
|
||||
private FileStream _raf = null;
|
||||
private Stream _raf = null;
|
||||
|
||||
/// <summary>
|
||||
/// header blocks buffer
|
||||
|
|
@ -75,6 +75,18 @@ namespace IP2Region
|
|||
|
||||
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
|
||||
/// <summary>
|
||||
/// Get the region with a int ip address with memory binary search algorithm.
|
||||
|
|
|
|||
Loading…
Reference in New Issue