def configure_record(record, bytes)
      byte = bytes.shift

      record.version     = (byte >> 3) & 31         # 5 bits  DIME format version (always 1)
      record.first       = (byte >> 2) & 1          # 1 bit   Set if this is the first part in the message
      record.last        = (byte >> 1) & 1          # 1 bit   Set if this is the last part in the message
      record.chunked     = byte & 1                 # 1 bit   This file is broken into chunked parts
      record.type_format = (bytes.shift >> 4) & 15  # 4 bits  Type of file in the part (1 for binary data, 2 for XML)
                                                    # 4 bits  Reserved (skipped in the above command)
    end
def configure_record(record, bytes)
      byte = bytes.shift

      record.version     = (byte >> 3) & 31         # 5 bits  DIME format version (always 1)
      record.first       = (byte >> 2) & 1          # 1 bit   Set if this is the first part in the message
      record.last        = (byte >> 1) & 1          # 1 bit   Set if this is the last part in the message
      record.chunked     = byte & 1                 # 1 bit   This file is broken into chunked parts
      record.type_format = (bytes.shift >> 4) & 15  # 4 bits  Type of file in the part (1 for binary data, 2 for XML)
                                                    # 4 bits  Reserved (skipped in the above command)
    end
Shift out bitfields for the first fields.