def __init__(self, value): data = bytearray() if isinstance(value, bytearray): data = value if isinstance(value, np.int8): data = util.addByte(data, value) if isinstance(value, np.int16): data = util.addShort(data, value) if isinstance(value, np.int32): data = util.addInt(data, value) if isinstance(value, np.int64): data = util.addLong(data, value) if isinstance(value, np.float32): data = util.addFloat(data, value) if isinstance(value, np.complex128): data = util.addDouble(data, value) self.value = data
def wrapFloat(self, f): data = bytearray() data = util.addFloat(data, f) return TLVFixed(AMQPType.FLOAT, data)