public Write ( byte buffer, int offset, int count ) : void | ||
buffer | byte | /// The byte array /// |
offset | int | /// The offset into the byte array where to start. /// |
count | int | /// The number of bytes to write. /// |
Результат | void |
public override void Write(byte[] buffer, int offset, int count)
{
deflater_.SetInput(buffer, offset, count);
Deflate();
}
public byte[] Compress(byte[] bytData, params int[] ratio) { int compRatio = 9; try { if (ratio[0] > 0) { compRatio = ratio[0]; } } catch { throw; } try { var ms = new MemoryStream(); var defl = new Deflater(compRatio, false); Stream s = new DeflaterOutputStream(ms, defl); s.Write(bytData, 0, bytData.Length); s.Close(); byte[] compressedData = ms.ToArray(); return compressedData; } catch { throw; } }