def array_byte_to_4bit(array):
    """Convert an array of 4096 1-byte values to a 2048-byte array of 4096 4-bit values.
    The result is of type bytearray().
    Any values larger than 16 are taken modulo 16.
    Note that the first byte of the original array will be placed in the LEAST 
    significant bits of the first byte of the result. Thus NOT to the MOST 
    significant bits, as you might expected. This is because Minecraft stores 
    data in that way.
    """
    def iterarray(array):
        arrayiter = iter(array)
        for b1 in arrayiter:
            b2 = next(arrayiter, 0)
            yield(((b2 & 15) << 4) + (b1 & 15))
    return bytearray(iterarray(array))