Skip to content

Commit

Permalink
More style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceCheetah committed Jun 11, 2024
1 parent e1d2bce commit 4d58c69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions LiteDB/Client/Storage/LiteFileStream.Read.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static LiteDB.Constants;
Expand All @@ -7,6 +8,7 @@ namespace LiteDB
{
public partial class LiteFileStream<TFileId> : Stream
{
private Dictionary<int, long> _chunkLengths = new Dictionary<int, long>();
public override int Read(byte[] buffer, int offset, int count)
{
if (_mode != FileAccess.Read) throw new NotSupportedException();
Expand Down Expand Up @@ -85,6 +87,7 @@ private void SetReadStreamPosition(long newPosition)
}
newChunkIndex++;
}

newChunkIndex--;
seekStreamPosition -= _chunkLengths[newChunkIndex];
_positionInChunk = (int)(_streamPosition - seekStreamPosition);
Expand Down
2 changes: 0 additions & 2 deletions LiteDB/Client/Storage/LiteFileStream.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static LiteDB.Constants;
Expand All @@ -24,7 +23,6 @@ public partial class LiteFileStream<TFileId> : Stream
private byte[] _currentChunkData = null;
private int _positionInChunk = 0;
private MemoryStream _buffer;
private Dictionary<int, long> _chunkLengths = new Dictionary<int, long>();

internal LiteFileStream(ILiteCollection<LiteFileInfo<TFileId>> files, ILiteCollection<BsonDocument> chunks, LiteFileInfo<TFileId> file, BsonValue fileId, FileAccess mode)
{
Expand Down

0 comments on commit 4d58c69

Please sign in to comment.