1- using System ;
1+ using LogExpert . Config ;
2+ using LogExpert . Entities ;
3+
4+ using System ;
25using System . IO ;
36using System . Text ;
4- using LogExpert . Entities ;
57
68namespace LogExpert . Classes . Log
79{
810 public abstract class PositionAwareStreamReaderBase : LogStreamReaderBase
911 {
1012 #region Fields
1113
12- private const int MAX_LINE_LEN = 20000 ;
13-
1414 private static readonly Encoding [ ] _preambleEncodings = { Encoding . UTF8 , Encoding . Unicode , Encoding . BigEndianUnicode , Encoding . UTF32 } ;
1515
1616 private readonly BufferedStream _stream ;
@@ -35,7 +35,7 @@ protected PositionAwareStreamReaderBase(Stream stream, EncodingOptions encodingO
3535 _posIncPrecomputed = GetPosIncPrecomputed ( usedEncoding ) ;
3636
3737 _reader = new StreamReader ( _stream , usedEncoding , true ) ;
38-
38+
3939 Position = 0 ;
4040 }
4141
@@ -54,7 +54,7 @@ public sealed override long Position
5454 /*
5555 * 1: Sometime commented (+Encoding.GetPreamble().Length)
5656 * 2: Date 1.1 3207
57- * 3: Error Message from Piet because of Unicode-Bugs.
57+ * 3: Error Message from Piet because of Unicode-Bugs.
5858 * No Idea, if this is OK.
5959 * 4: 27.07.09: Preamble-Length is now calculated in CT, because Encoding.GetPreamble().Length
6060 * always delivers a fixed length (does not mater what kind of data)
@@ -72,7 +72,7 @@ public sealed override long Position
7272
7373 public sealed override bool IsBufferComplete => true ;
7474
75- protected static int MaxLineLen => MAX_LINE_LEN ;
75+ protected static int MaxLineLen => ConfigManager . Settings . preferences . MaxLineLength ;
7676
7777 #endregion
7878
@@ -149,11 +149,11 @@ protected void MovePosition(int offset)
149149 private int DetectPreambleLengthAndEncoding ( out Encoding detectedEncoding )
150150 {
151151 /*
152- UTF-8: EF BB BF
153- UTF-16-Big-Endian-Byteorder: FE FF
154- UTF-16-Little-Endian-Byteorder: FF FE
155- UTF-32-Big-Endian-Byteorder: 00 00 FE FF
156- UTF-32-Little-Endian-Byteorder: FF FE 00 00
152+ UTF-8: EF BB BF
153+ UTF-16-Big-Endian-Byteorder: FE FF
154+ UTF-16-Little-Endian-Byteorder: FF FE
155+ UTF-32-Big-Endian-Byteorder: 00 00 FE FF
156+ UTF-32-Little-Endian-Byteorder: FF FE 00 00
157157 */
158158
159159 byte [ ] readPreamble = new byte [ 4 ] ;
@@ -205,17 +205,17 @@ private int GetPosIncPrecomputed(Encoding usedEncoding)
205205 switch ( usedEncoding )
206206 {
207207 case UTF8Encoding _:
208- {
209- return 0 ;
210- }
208+ {
209+ return 0 ;
210+ }
211211 case UnicodeEncoding _:
212- {
213- return 2 ;
214- }
212+ {
213+ return 2 ;
214+ }
215215 default :
216- {
217- return 1 ;
218- }
216+ {
217+ return 1 ;
218+ }
219219 }
220220 }
221221
0 commit comments