added routines to read various data types from buffer; added other helper buffer routines