// Copyright 2023 The Ip2Region Authors. All rights reserved. // Use of this source code is governed by a Apache2.0-style // license that can be found in the LICENSE file. // @Author Alan // @Date 2023/07/25 using IP2Region.Net.Internal.Abstractions; namespace IP2Region.Net.Internal; internal class VectorIndexCacheStrategy(string xdbPath) : AbstractCacheStrategy(xdbPath) { ReadOnlyMemory _vectorCahe = default; public override ReadOnlyMemory GetVectorIndexStartPos(int offset) { if (_vectorCahe.IsEmpty) { _vectorCahe = base.GetData(256, 256 * 256 * 8); } return _vectorCahe.Slice(offset, 8); } }