def each_raw
      unless block_given?
        return self.enum_for(:each_raw)
      else
        while rec_length_s = @handle.read(5)
          # make sure the record length looks like an integer
          rec_length_i = rec_length_s.to_i
          if rec_length_i == 0
            raise MARC::Exception.new("invalid record length: #{rec_length_s}")
          end

          # get the raw MARC21 for a record back from the file
          # using the record length
          raw = rec_length_s + @handle.read(rec_length_i-5)
          yield raw
        end
      end
    end
def each_raw
      unless block_given?
        return self.enum_for(:each_raw)
      else
        while rec_length_s = @handle.read(5)
          # make sure the record length looks like an integer
          rec_length_i = rec_length_s.to_i
          if rec_length_i == 0
            raise MARC::Exception.new("invalid record length: #{rec_length_s}")
          end

          # get the raw MARC21 for a record back from the file
          # using the record length
          raw = rec_length_s + @handle.read(rec_length_i-5)
          yield raw
        end
      end
    end
Iterates over each record as a raw String, rather than a decoded
 MARC::Record

 This allows for handling encoding exceptions per record (e.g. to log which
 record caused the error):

   reader = MARC::Reader.new("marc_with_some_bad_records.dat",
                                 :external_encoding => "UTF-8",
                                 :validate_encoding => true)
   reader.each_raw do |raw|
     begin
       record = reader.decode(raw)
     rescue Encoding::InvalidByteSequenceError => e
       record = MARC::Reader.decode(raw, :external_encoding => "UTF-8",
                                         :invalid => :replace)
       warn e.message, record
     end
   end

 If no block is given, an enumerator is returned