CAD Micro is now part of:

Learn More >>
Together with GoEngineer, you will get local, personal customer service and support, now with access to even more resources. For more detailed questions & answers, please visit our FAQ.

Discipline Zerozip Access

# Compress the data using Discipline Zerozip compressed_data = discipline_zerozip.compress(data)

# Iterate through the compressed data while len(compressed_data) > 0: # Read the block type (zero-filled or non-zero-filled) block_type = struct.unpack_from('B', compressed_data)[0] compressed_data = compressed_data[1:] discipline zerozip

# Sample data with zero-filled blocks data = b'\x00\x00\x00\x00\x00\x00\x00\x00' * 1024 + b'Hello, World!' + b'\x00\x00\x00\x00\x00\x00\x00\x00' * 512 # Compress the data using Discipline Zerozip compressed_data

import struct

def _compress_non_zero_block(self, block): # Compress the non-zero-filled block using RLE and entropy coding compressed_block = bytearray() i = 0 while i < len(block): count = 1 while i + 1 < len(block) and block[i] == block[i + 1]: i += 1 count += 1 compressed_block.extend(struct.pack('B', count)) compressed_block.extend(bytes([block[i]])) i += 1 return bytes(compressed_block) discipline zerozip

Draftsight enterprise | contact form

Complete the form below, and a member of our expert team will reach out to you as soon as possible. If you require immediate assistance please contact us toll-free at: Toll-free: 1-888-401-5885

Request A quote

Complete the form below, and a member of our expert team will reach out to you as soon as possible. If you require immediate assistance please contact us toll-free at: Toll-free: 1-888-401-5885