public static ParserBase FromByteArray(byte[] datas, IExceptionHandler handler) { BinaryReader rd = new BinaryReader( new MemoryStream(datas, false), Encoding.ASCII, false); ParserBase result = Deserialize(rd, handler); rd.Dispose(); return(result); }
public static ParserBase FromFile(string filePath, IExceptionHandler handler) { if (File.Exists(filePath) == false) { throw new FileNotFoundException(filePath); } BinaryReader rd = new BinaryReader( File.OpenRead(filePath), Encoding.ASCII, false); ParserBase result = Deserialize(rd, handler); rd.Dispose(); return(result); }