##// END OF EJS Templates
Fixed promise rejection when there is not specified error handler in the reaction....
Fixed promise rejection when there is not specified error handler in the reaction. FIXED SPELLING IN THE XML CONTAINER CONFIGURATION signleton->singleton Code cleanup Update tests make them working on dotnet core

File last commit:

r295:28af686e24f7 default
r295:28af686e24f7 default
Show More
JsonTextScanner.cs
45 lines | 1.6 KiB | text/x-csharp | CSharpLexer
/ Implab / src / Formats / Json / JsonTextScanner.cs
cin
Fixed promise rejection when there is not specified error handler in the reaction....
r295 using System.IO;
cin
Added tests for Implab.ServiceHost.Unity configuration loader.
r289 using System.Text;
namespace Implab.Formats.Json {
public class JsonTextScanner : JsonScanner {
const int _bufferSize = 16*4096;
readonly TextReader m_reader;
JsonTextScanner(TextReader reader, char[] buffer) : base(buffer, 0, 0) {
m_reader = reader;
}
protected override int Read(char[] buffer, int offset, int size) {
return m_reader.Read(buffer, offset, size);
}
public static JsonTextScanner Create(string file, Encoding encoding) {
return new JsonTextScanner(new StreamReader(file, encoding), new char[_bufferSize]);
}
public static JsonTextScanner Create(string file) {
return new JsonTextScanner(new StreamReader(file), new char[_bufferSize]);
}
public static JsonTextScanner Create(Stream stream, Encoding encoding) {
return new JsonTextScanner(new StreamReader(stream, encoding), new char[_bufferSize]);
}
public static JsonTextScanner Create(Stream stream) {
return new JsonTextScanner(new StreamReader(stream), new char[_bufferSize]);
}
public static JsonTextScanner Create(TextReader reader) {
Safe.ArgumentNotNull(reader, nameof(reader));
return new JsonTextScanner(reader, new char[_bufferSize]);
}
protected override void Dispose(bool disposing) {
if (disposing)
Safe.Dispose(m_reader);
base.Dispose(disposing);
}
}
}