SceneGate / Yarhl

Framework for the implementation of format converters like game assets or media files
https://scenegate.github.io/Yarhl/
MIT License
60 stars 10 forks source link

Implement factories to create DataStreams and Nodes from array and standard streams #173

Closed pleonex closed 2 years ago

pleonex commented 2 years ago

Description

Implement API in the NodeFactory and DataStreamFactory to create objects from arrays and streams. Also include the README in the NuGets for visibility in nuget.org.

Example

byte[] myData = new byte[] { 1, 2, 3 };

using var stream = DataStreamFactory.FromArray(myData);

using var node1 = NodeFactory.FromArray("node1", myData);
using var node2 = NodeFactory.FromArray("node2", myData, 1, 2);

var commonStream = new MemoryStream();
using var node3 = NodeFactory.FromStream("node3", commonStream);