add uint32uint8array

This commit is contained in:
David Rose 2001-09-25 00:48:43 +00:00
parent ecc2c11600
commit e3a9436f07
2 changed files with 19 additions and 0 deletions

View File

@ -48,6 +48,11 @@
self.addUint16(len(arg) << 2)
for i in arg:
self.addUint32(int(i*divisor))
elif subatomicType == STUint32uint8array:
self.addUint16(len(arg) * 5)
for i in arg:
self.addUint32(int(i[0]*divisor))
self.addUint8(int(i[1]*divisor))
else:
raise Exception("Error: No such type as: " + subatomicType)
return None

View File

@ -56,6 +56,13 @@
retVal = []
for i in range(len):
retVal.append(self.getUint32())
elif subatomicType == STUint32uint8array:
len = self.getUint16() / 5
retVal = []
for i in range(len):
a = self.getUint32()
b = self.getUint8()
retVal.append((a, b))
else:
raise Exception("Error: No such type as: " + str(subAtomicType))
else:
@ -112,6 +119,13 @@
retVal = []
for i in range(len):
retVal.append(self.getUint32()/float(divisor))
elif subatomicType == STUint32uint8array:
len = self.getUint16() / 5
retVal = []
for i in range(len):
a = self.getUint32()
b = self.getUint8()
retVal.append((a / float(divisor), b / float(divisor)))
else:
raise Exception("Error: No such type as: " + str(subAtomicType))