indexing description: "[ The EM network serializer. ]" date: "$Date$" revision: "$Revision$" class EM_NET_SERIALIZER inherit EM_NETWORK_HELPER_FUNCTIONS export {NONE} all end EM_BASE_FUNCTIONS export {NONE} all end KL_STRING_OUTPUT_STREAM redefine put_integer end create make, make_empty feature -- Integer operation put_integer (an_i: INTEGER) is -- Put an integer (32 bits) to the stream in network byte order. local net_order: INTEGER do net_order := convert_to_big_endian_32 (an_i) put_character (net_order.bit_shift_right (24).bit_and (255).to_character) put_character (net_order.bit_shift_right (16).bit_and (255).to_character) put_character (net_order.bit_shift_right (8).bit_and (255).to_character) put_character (net_order.bit_shift_right (0).bit_and (255).to_character) end put_integer_16 (an_i: INTEGER_16) is -- Put an short integer (16 bits) to the stream in network byte order local net_order: INTEGER do net_order := convert_to_big_endian_32 (an_i.to_integer_32) put_character (net_order.bit_shift_right (8).bit_and (255).to_character) put_character (net_order.bit_shift_right (0).bit_and (255).to_character) end put_integer_8 (an_i: INTEGER_8) is -- Put a byte (8 bits) to the stream in network byte order. do put_character (an_i.to_character) end feature -- Real operation put_real (r: REAL) is -- Put a real to the stream. local tmp: INTEGER do tmp := cast_float_to_int (r) put_character (tmp.bit_shift_right (24).bit_and (255).to_character) put_character (tmp.bit_shift_right (16).bit_and (255).to_character) put_character (tmp.bit_shift_right (8).bit_and (255).to_character) put_character (tmp.bit_shift_right (0).bit_and (255).to_character) end end