@@ -10,7 +10,8 @@ public partial class LiteFileStream<TFileId> : Stream
1010 public override int Read ( byte [ ] buffer , int offset , int count )
1111 {
1212 if ( _mode != FileAccess . Read ) throw new NotSupportedException ( ) ;
13- if ( _streamPosition == Length ) {
13+ if ( _streamPosition == Length )
14+ {
1415 return 0 ;
1516 }
1617
@@ -46,7 +47,8 @@ private byte[] GetChunkData(int index)
4647
4748 // if chunk is null there is no more chunks
4849 byte [ ] result = chunk ? [ "data" ] . AsBinary ;
49- if ( result != null ) {
50+ if ( result != null )
51+ {
5052 _chunkLengths [ index ] = result . Length ;
5153 }
5254 return result ;
@@ -58,7 +60,8 @@ private void SetReadStreamPosition(long newPosition)
5860 {
5961 throw new ArgumentOutOfRangeException ( ) ;
6062 }
61- if ( newPosition >= Length ) {
63+ if ( newPosition >= Length )
64+ {
6265 _streamPosition = Length ;
6366 return ;
6467 }
@@ -68,11 +71,14 @@ private void SetReadStreamPosition(long newPosition)
6871 long seekStreamPosition = 0 ;
6972 int loadedChunk = _currentChunkIndex ;
7073 int newChunkIndex = 0 ;
71- while ( seekStreamPosition <= _streamPosition ) {
72- if ( _chunkLengths . TryGetValue ( newChunkIndex , out long length ) ) {
74+ while ( seekStreamPosition <= _streamPosition )
75+ {
76+ if ( _chunkLengths . TryGetValue ( newChunkIndex , out long length ) )
77+ {
7378 seekStreamPosition += length ;
7479 }
75- else {
80+ else
81+ {
7682 loadedChunk = newChunkIndex ;
7783 _currentChunkData = GetChunkData ( newChunkIndex ) ;
7884 seekStreamPosition += _currentChunkData . Length ;
@@ -83,7 +89,8 @@ private void SetReadStreamPosition(long newPosition)
8389 seekStreamPosition -= _chunkLengths [ newChunkIndex ] ;
8490 _positionInChunk = ( int ) ( _streamPosition - seekStreamPosition ) ;
8591 _currentChunkIndex = newChunkIndex ;
86- if ( loadedChunk != _currentChunkIndex ) {
92+ if ( loadedChunk != _currentChunkIndex )
93+ {
8794 _currentChunkData = GetChunkData ( _currentChunkIndex ) ;
8895 }
8996 }
0 commit comments