简体   繁体   English

脚本#和System.IO.Stream

[英]Script# and System.IO.Stream

I'm currently working on getting the C# Source for the 7-Zip compression library to compile on Script# but facing the problem that System.IO.Stream is not supported in Script#'s version of the BCL. 我目前正在为7-Zip压缩库获取C#源代码,以在Script#上进行编译,但面临的问题是Script#的BCL版本不支持System.IO.Stream。 Any suggestions how to handle this? 有什么建议如何处理吗?

You could theoretically define a Stream and implement on your end over an array of numbers corresponding to the bytes - script isn't all that great at dealing with byte sequences however (until we get typed arrays in script). 从理论上讲,您可以定义一个Stream并在与字节对应的数字数组上实现-脚本在处理字节序列方面并不是那么出色(直到我们在脚本中得到类型化的数组)。

Streams aren't that commonly used within script code - typically you have a text response for example from an XHR request, or a base64-encoded string for image data from a canvas element (some typical cases where you might have expected streams). 流不是脚本代码中常用的流-通常,您会收到来自XHR请求的文本响应,或者来自canvas元素的图像数据的base64编码的字符串(某些典型情况下,您可能会有预期的流)。 Hence they're not there out-of-the-box. 因此,它们并不是开箱即用的。

If you do define one, perhaps you can share your work. 如果您定义一个,也许可以分享您的工作。 If you think the 7-zip compression you have is general purpose enough, and publicly shareable, would love to discuss further. 如果您认为所拥有的7-zip压缩足够通用且可以公开分享,不妨进一步讨论。 As you hopefully know, script# is on github, and would be interesting to see an ecosystem of community contributions and extensions. 如您所希望的那样,script#在github上,并且很有趣地看到社区贡献和扩展的生态系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM