EndianOutput¶
-
class
EndianOutput(outStream, byteOrder=None)[source]¶ Bases:
objectThis class handles the conversion of values used by pyasdm objects into a buffered byte stream output previous opened.
Methods Summary
byteOrder()Return the ByteOrder instance used by this EndianOutput.
close()Close the output stream being written to.
closed()Returns True if the output stream is closed.
writeBool(boolVal)Write a a bool value as 1 byte to the output stream.
writeByte(byteVal)Writes a bytes value to the output stream.
writeDouble(dblVal)Write a float value to the output stream as a 8-byte float
writeFloat(floatVal)Write a float value to the output stream as a 4-byte float
writeInt(intVal)Write an integer to the output stream as a bytes instance, representing a 4-byte integer.
writeLong(intVal)Write an integer to the output stream as a bytes instance, representing an 8-byte integer.
writeShort(shortVal)Write an integer to the output stream as a 2-element bytes instance
writeStr(strVal)Identical to writeString, used by the template generator for reasons.
writeString(strVal)Write a string to the output stream as first a 4-byte integer representing the length of strVal followed by the bytes that make up strVal.
writeUInt(intVal)Write an integer to the output stream as a bytes instance, representing an unsigned 4-byte integer.
writeULong(intVal)Write an integer to the output stream as a bytes instance, representing an 8-byte unsigned integer.
writeUShort(uShortVal)Write an integer to the otuput stream as a 2-element bytes instance representing an unsigned integer.
Methods Documentation
-
writeByte(byteVal)[source]¶ Writes a bytes value to the output stream. If byteVal is an integer this assumes it can be represented as a single byte and it converts it to that representation. Any other type fir byteVal is an error
-
writeInt(intVal)[source]¶ Write an integer to the output stream as a bytes instance, representing a 4-byte integer.
-
writeLong(intVal)[source]¶ Write an integer to the output stream as a bytes instance, representing an 8-byte integer.
-
writeString(strVal)[source]¶ Write a string to the output stream as first a 4-byte integer representing the length of strVal followed by the bytes that make up strVal.
-
writeUInt(intVal)[source]¶ Write an integer to the output stream as a bytes instance, representing an unsigned 4-byte integer.
-