#NEWLINE# def buffer_to_value( self , obj , buffer , offset , default_endianness = DEFAULT_ENDIANNESS ) : #NEWLINE# #INDENT# end = buffer #NEWLINE# if ( end >= len ( buffer ) ) : #NEWLINE# #INDENT# raise PacketDecodeError ( '{}: No bytes available.' ) #NEWLINE# #UNINDENT# while ( buffer [ end ] != b'\x00' [ 0 ] ) : #NEWLINE# #INDENT# print ( buffer [ end ] ) #NEWLINE# end += 1 #NEWLINE# if ( end >= len ( buffer ) ) : #NEWLINE# #INDENT# raise PacketDecodeError ( '{}: Reached end of buffer without terminating.' . format ( self . type ) ) #NEWLINE# #UNINDENT# #UNINDENT# return ( buffer [ offset : end ] . split ( b'\x00' ) [ 0 ] . decode ( 'utf-8' ) , ( ( end - offset ) + 1 ) )