decode raw as buffer