English 中文(简体)
java.util.zip.deflater Equal in c#
原标题:java.util.zip.deflater equivalent in c#

任何人都知道我如何能够实现 j。 Deflate()Function in .NET, so,java s Infalter.inflate()方法是可以理解的?

regards, Rafal

最佳回答
问题回答

ZlibStream在DotNetZip包(https://dotnetzip.codeplex.com/)中的等级相当于java.util.zip.deflater。

Nuget: Install-Package DotNetZip

单体阵列的使用:

ZlibStream.CompressBuffer(dataBytesArray);

ZlibStream.UncompressBuffer(dataBytesArray);

它还有压缩和压缩,而且这一类与网络DefalteStream完全一样。 请注意,DotNetZip的DeflateStream与Java不同,ZlibStream是一样的。

Additional Info: DeflateStream of .NET is not compatible with Deflate in Java. In fact, Java uses Zlib and adds 2-6 bytes header and 4 bytes checksum by default. Cutting off the bytes (suggested by some articles like http://blogs.msdn.com/b/bclteam/archive/2007/05/16/system-io-compression-capabilities-kim-hamilton.aspx) will work, but I don t suggest it as parsing header length may cause bugs.

我不建议SharpZipLib,因为它纯粹是C#,而且通常业绩与压缩和压缩数据有关。 查阅

http://msdn.microsoft.com/en-us/library/system.io.compression.aspx”rel=“nofollow” System.IO.Compression namespace. http://msdn.microsoft.com/en-us/library/system.io.compression.deflatestream.aspx”rel=“nofollow” DeflateStream使用压缩计算法,也使用java.util.zip.deflater。 因此,你可以压缩。 NET and decompress with Java implementation and 相反.

There

甲型六氯环己烷

http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx” rel=“nofollow> GZipStream Level

which might help, but I don t know how easy they are to use 或 if compatible with java (s或ry not a great answer).

There a nice blog post about zip stuff in: http://blogs.msdn.com/b/bclteam/archive/2010/06/28/w或king-with-zip-files-in-net.aspx

Or a few open source zip utilities around f或 c#.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签