Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
>>> import array
>>> a = array.array('i', range(1000*1000))
>>> a_bytesobj = a.tostring()
>>> c_bytesobj = blosc.compress(a_bytesobj, typesize=4)
>>> len(c_bytesobj) < len(a_bytesobj)
True
"""
_check_input_length('bytesobj', len(bytesobj))
_check_typesize(typesize)
_check_shuffle(shuffle)
_check_clevel(clevel)
_check_cname(cname)
return _ext.compress(bytesobj, typesize, clevel, shuffle, cname)
True
"""
if type(string) is not bytes:
raise ValueError(
"only string (2.x) or bytes (3.x) objects supported as input")
if len(string) > _ext.BLOSC_MAX_BUFFERSIZE:
raise ValueError("string length cannot be larger than %d bytes" % \
_ext.BLOSC_MAX_BUFFERSIZE)
if clevel < 0 or clevel > 9:
raise ValueError("clevel can only be in the 0-9 range.")
return _ext.compress(string, typesize, clevel, shuffle)