Index: src/Common/NetTopologySuite/Utilities/RToolsUtil/BufferedTextReader.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/Common/NetTopologySuite/Utilities/RToolsUtil/BufferedTextReader.cs (.../BufferedTextReader.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/Common/NetTopologySuite/Utilities/RToolsUtil/BufferedTextReader.cs (.../BufferedTextReader.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -20,54 +20,57 @@ namespace RTools_NTS.Util { - /// - /// Wraps a TextReader with buffering for speed. This is not finished, - /// and preliminary testing indicates it isn't faster than FCL implementation. - /// - public class BufferedTextReader - { - static readonly int BlockSize = 1024; - TextReader reader; - char[] buffer; - CharBuffer cb; + /// + /// Wraps a TextReader with buffering for speed. This is not finished, + /// and preliminary testing indicates it isn't faster than FCL implementation. + /// + public class BufferedTextReader + { + private static readonly int BlockSize = 1024; + private readonly TextReader reader; + private readonly char[] buffer; + private CharBuffer cb; - /// - /// Constructor - /// - /// The TextReader to wrap. - public BufferedTextReader(TextReader reader) - { - this.reader = reader; - buffer = new char[BlockSize]; - cb = new CharBuffer(0); - } + /// + /// Constructor + /// + /// The TextReader to wrap. + public BufferedTextReader(TextReader reader) + { + this.reader = reader; + buffer = new char[BlockSize]; + cb = new CharBuffer(0); + } - /// - /// Read a single character. - /// - /// The character read. - public char Read() - { - if (cb.Length == 0) - { - // read from underlying reader - int readCount = reader.Read(buffer, 0, BlockSize); - if (readCount == 0) throw new ApplicationException("End of stream."); - cb.SetBuffer(buffer, readCount); - } + /// + /// Read a single character. + /// + /// The character read. + public char Read() + { + if (cb.Length == 0) + { + // read from underlying reader + int readCount = reader.Read(buffer, 0, BlockSize); + if (readCount == 0) + { + throw new ApplicationException("End of stream."); + } + cb.SetBuffer(buffer, readCount); + } - char c = cb[0]; - cb.Remove(0); - return(c); - } + char c = cb[0]; + cb.Remove(0); + return (c); + } - /// - /// Close the underlying reader. - /// - public void Close() - { - reader.Close(); - cb = null; - } - } -} + /// + /// Close the underlying reader. + /// + public void Close() + { + reader.Close(); + cb = null; + } + } +} \ No newline at end of file