public virtual void Load( TextReader r, int size, int readChunkSize ) { if ( r == null ) { return; } if ( size <= 0 ) { size = InitialBufferSize; } if ( readChunkSize <= 0 ) { readChunkSize = ReadBufferSize; } // System.out.println("load "+size+" in chunks of "+readChunkSize); try { data = r.ReadToEnd().ToCharArray(); base.n = data.Length; } finally { r.Dispose(); } }
public Feature Parse(TextReader featureFileReader) { string fileContent = featureFileReader.ReadToEnd(); var parser = new PicklesParser(this.languageService.GetLanguage()); Lexer lexer = this.languageService.GetNativeLexer(parser); lexer.scan(fileContent); return parser.GetFeature(); }
public static CharStream Get(System.IO.TextReader input) { var charStream = input as CharStream; if (charStream != null) { return(charStream); } // {{Aroush-2.9}} isn't there a better (faster) way to do this? var theString = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(input.ReadToEnd())); return(new CharReader(new System.IO.StreamReader(theString))); //return input is CharStream?(CharStream) input:new CharReader(input); }
/// <summary> /// Searches the text provided by the text reader for matches of the search query. /// </summary> /// <param name="textReader">Text reader providing text to be searched.</param> /// <param name="searchQuery">Search query.</param> /// <returns>Enumeration of matches of the search query.</returns> public IEnumerable <IOccurrence> Search(System.IO.TextReader textReader, string searchQuery) { return(Search(textReader.ReadToEnd(), searchQuery)); }
private void loadText(System.IO.TextReader sr) { textBox1.Text = sr.ReadToEnd(); //replace all contents of textBox //ReadToEnd() forms a string with a StringBuilder, thus equality }
public virtual string ReadToEnd() { return(backingReader.ReadToEnd()); }
//Reads all text from file and sets it as the text in the textbox //Will also accept out FibonacciTextReader class private void LoadText(System.IO.TextReader sr) { string numbs = sr.ReadToEnd(); textBox1.Text = numbs; }
public virtual void Load( TextReader r, int size, int readChunkSize ) { if ( r == null ) { return; } if ( size <= 0 ) { size = INITIAL_BUFFER_SIZE; } if ( readChunkSize <= 0 ) { readChunkSize = READ_BUFFER_SIZE; } // System.out.println("load "+size+" in chunks of "+readChunkSize); try { data = r.ReadToEnd().ToCharArray(); base.n = data.Length; } finally { r.Close(); } }
/// <summary> /// DeSerializes text of <paramref name="TextReader"/> /// to <see cref="IEnumerable{T}"/> /// </summary> /// <param name="TextReader">Source <see cref="System.IO.TextReader"/></param> /// <param name="UseFirstRowAsHeaders"> /// When true, the First row of the CSV File will be used as column headers. /// When false, the Column Index defined in <see cref="CsvColumnAttribute"/> will be used. /// </param> /// <returns><see cref="IEnumerable{T}"/> with values from <paramref name="TextReader"/></returns> public IEnumerable<T> DeSerialize(System.IO.TextReader TextReader, bool UseFirstRowAsHeaders = true) => DeSerializeText(TextReader.ReadToEnd(), UseFirstRowAsHeaders);