Exemplo n.º 1
0
        private static TDataType[] StreamReadData <TDataType>(string filePath)
        {
            FileStream   stream = null;
            BinaryReader reader = null;

            try
            {
                long byteSize = FileUtil.InitBinReadStream(ref stream, ref reader, filePath);
                return(FileUtil.StreamReadFromBinFile <TDataType>(reader, byteSize, 0));
            }
            catch (SeeSharpFileException)
            {
                throw;
            }
            catch (ApplicationException ex)
            {
                throw new SeeSharpFileException(SeeSharpFileErrorCode.RuntimeError,
                                                i18n.GetFStr("Runtime.ReadFail", ex.Message), ex);
            }
            finally
            {
                FileUtil.ReleaseResource(reader);
                FileUtil.ReleaseResource(stream);
            }
        }