/// <summary>
        /// Loads a data stream as a <see cref="FrontendPackage"/>.
        /// </summary>
        /// <param name="br">The <see cref="BinaryReader"/> for the data stream.</param>
        /// <returns>A new <see cref="FrontendPackage"/> instance.</returns>
        public FrontendPackage Load(BinaryReader br)
        {
            FrontendPackage     package     = new FrontendPackage();
            FrontendChunkReader chunkReader = new FrontendChunkReader(package, br);

            foreach (var chunk in chunkReader.ReadMainChunks())
            {
                switch (chunk)
                {
                case PackageHeaderChunk packageHeaderChunk:
                    this.ProcessPackageHeaderChunk(package, packageHeaderChunk);
                    break;

                case ObjectContainerChunk objectContainerChunk:
                    ProcessObjectContainerChunk(package, objectContainerChunk);
                    break;
                }
            }

            return(package);
        }
Beispiel #2
0
 public abstract void Read(FrontendPackage package, FrontendChunkBlock chunkBlock,
                           FrontendChunkReader chunkReader, BinaryReader reader);