def read_data(record, bytes, attribute_set)
      attribute, length = attribute_set
      content = bytes.slice!(0, length).pack('C*')

      if attribute == :data && record.type_format == BINARY
        content = StringIO.new(content)
      end

      record.send "#{attribute.to_s}=", content
      bytes.slice!(0, 4 - (length & 3)) if (length & 3) != 0
    end
def read_data(record, bytes, attribute_set)
      attribute, length = attribute_set
      content = bytes.slice!(0, length).pack('C*')

      if attribute == :data && record.type_format == BINARY
        content = StringIO.new(content)
      end

      record.send "#{attribute.to_s}=", content
      bytes.slice!(0, 4 - (length & 3)) if (length & 3) != 0
    end
Read in padded data.