Пример #1
0
 def putClob(self, value):
     """Appends the Clob(Character Large OBject) value to the message."""
     length = len(value)
     lengthStr = toByteString(length)
     packed = chr(protocol.CLOBLEN0 + len(lengthStr)) + lengthStr + value
     self.__output += packed
     return self
Пример #2
0
 def putClob(self, value):
     """Appends the Clob(Character Large OBject) value to the message."""
     length = len(value)
     lengthStr = toByteString(length)
     packed = chr(protocol.CLOBLEN0 + len(lengthStr)) + lengthStr + value
     self.__output += packed
     return self
Пример #3
0
 def putBlob(self, value):
     """Appends the Blob(Binary Large OBject) value to the message."""
     data = value.string
     length = len(data)
     lengthStr = toByteString(length)
     lenlengthstr = len(lengthStr)
     packed = chr(protocol.BLOBLEN0 + lenlengthstr) + lengthStr + data
     self.__output += packed
     return self
Пример #4
0
 def putBlob(self, value):
     """Appends the Blob(Binary Large OBject) value to the message."""
     data = value.string
     length = len(data)
     lengthStr = toByteString(length)
     lenlengthstr = len(lengthStr)
     packed = chr(protocol.BLOBLEN0 + lenlengthstr) + lengthStr + data
     self.__output += packed
     return self
Пример #5
0
 def putScaledTime(self, value):
     """Appends a Scaled Time value to the message."""
     (ticks, scale) = datatype.TimeToTicks(value)
     valueStr = toByteString(ticks)
     if len(valueStr) == 0:
         packed = chr(protocol.SCALEDTIMELEN1) + chr(0) + chr(0)
     else:
         packed = chr(protocol.SCALEDTIMELEN1 - 1 + len(valueStr)) + chr(scale) + valueStr
     self.__output += packed
     return self
Пример #6
0
 def putString(self, value):
     """Appends a String to the message."""
     length = len(value)
     if length < 40:
         packed = chr(protocol.UTF8LEN0 + length) + value
     else:
         lengthStr = toByteString(length)
         packed = chr(protocol.UTF8COUNT1 - 1 + len(lengthStr)) + lengthStr + value
     self.__output += packed
     return self
Пример #7
0
 def putOpaque(self, value):
     """Appends an Opaque data value to the message."""
     data = value.string
     length = len(data)
     if length < 40:
         packed = chr(protocol.OPAQUELEN0 + length) + data
     else:
         lengthStr = toByteString(length)
         packed = chr(protocol.OPAQUECOUNT1 - 1 + len(lengthStr)) + lengthStr + data
     self.__output += packed
     return self
Пример #8
0
 def putScaledTime(self, value):
     """Appends a Scaled Time value to the message."""
     (ticks, scale) = datatype.TimeToTicks(value)
     valueStr = toByteString(ticks)
     if len(valueStr) == 0:
         packed = chr(protocol.SCALEDTIMELEN1) + chr(0) + chr(0)
     else:
         packed = chr(protocol.SCALEDTIMELEN1 - 1 +
                      len(valueStr)) + chr(scale) + valueStr
     self.__output += packed
     return self
Пример #9
0
 def putInt(self, value, isMessageId = False):
     """Appends an Integer value to the message."""
     if value < 32 and value > -11:
         packed = chr(protocol.INT0 + value)
     else:
         if isMessageId:
             valueStr = toByteString(value)
         else:
             valueStr = toSignedByteString(value)
         packed = chr(protocol.INTLEN1 - 1 + len(valueStr)) + valueStr
     self.__output += packed
     return self
Пример #10
0
 def putOpaque(self, value):
     """Appends an Opaque data value to the message."""
     data = value.string
     length = len(data)
     if length < 40:
         packed = chr(protocol.OPAQUELEN0 + length) + data
     else:
         lengthStr = toByteString(length)
         packed = chr(protocol.OPAQUECOUNT1 - 1 +
                      len(lengthStr)) + lengthStr + data
     self.__output += packed
     return self
Пример #11
0
 def putString(self, value):
     """
     Appends a String to the message.
     @type value str
     """
     length = len(value)
     if length < 40:
         packed = chr(protocol.UTF8LEN0 + length) + value
     else:
         lengthStr = toByteString(length)
         packed = chr(protocol.UTF8COUNT1 - 1 +
                      len(lengthStr)) + lengthStr + value
     self.__output += packed
     return self
Пример #12
0
 def putInt(self, value, isMessageId=False):
     """
     Appends an Integer value to the message.
     @type value int
     @type isMessageId bool
     """
     if value < 32 and value > -11:
         packed = chr(protocol.INT0 + value)
     else:
         if isMessageId:
             valueStr = toByteString(value)
         else:
             valueStr = toSignedByteString(value)
         packed = chr(protocol.INTLEN1 - 1 + len(valueStr)) + valueStr
     self.__output += packed
     return self
Пример #13
0
 def putMsSinceMidnight(self, value):
     """Appends the MsSinceMidnight value to the message."""
     valueStr = toByteString(value)
     packed = chr(protocol.TIMELEN0 + len(valueStr)) + valueStr
     self.__output += packed
     return self
Пример #14
0
 def putMsSinceMidnight(self, value):
     """Appends the MsSinceMidnight value to the message."""
     valueStr = toByteString(value)
     packed = chr(protocol.TIMELEN0 + len(valueStr)) + valueStr
     self.__output += packed
     return self