Read MSODRAWING record
9545
private function _readMsoDrawing()
	{
		$length = self::_GetInt2d($this->_data, $this->_pos + 2);

		// get spliced record data
		$splicedRecordData = $this->_getSplicedRecordData();
		$recordData = $splicedRecordData['recordData'];

		$this->_drawingData .= $recordData;
	}
1152327
public Object[] nextRecord() {
        try {
            int nextByte;
            do {
                nextByte = dataInput.readByte();
                if (nextByte == DATA_ENDED) {
                    return null;
                } else if (nextByte == DATA_DELETED) {
                    dataInput.skipBytes(header.getRecordLength() - 1);
                }
            } while (nextByte == DATA_DELETED);

            Object recordObjects[] = new Object[header.getFieldsCount()];
            for (int i = 0; i < header.getFieldsCount(); i++) {
                recordObjects[i] = readFieldValue(header.getField(i));
            }
            return recordObjects;
        } catch (EOFException e) {
            return null; // we currently end reading file
        } catch (IOException e) {
            throw new DbfException("Cannot read next record form Dbf file", e);
        }
    }
178125
def _read(self, f):
        """"""
        
        try:
            self.header = ord(f.read(1))
        except TypeError:
            log.debug("buffer underflow at offset {0}".format(f.tell()))
            raise LengthError("insufficient data to parse")
        
        mbf = bool(self.header & 0x80)
        mef = bool(self.header & 0x40)
        cff = bool(self.header & 0x20)
        srf = bool(self.header & 0x10)
        ilf = bool(self.header & 0x08)
        tnf = self.header & 0x07

        try:
            type_length = ord(f.read(1))
            if srf: # short record
                data_length = ord(f.read(1))
            else: # 32-bit length
                data_length = struct.unpack('>L', f.read(4))[0]
            if ilf: # id length present
                name_length = ord(f.read(1))
            else:
                name_length = 0
        except (TypeError, struct.error):
            log.debug("buffer underflow at offset {0}".format(f.tell()))
            raise LengthError("insufficient data to parse")

        try:
            record_type = f.read(type_length)
            assert len(record_type) == type_length
            record_name = f.read(name_length)
            assert len(record_name) == name_length
            record_data = f.read(data_length)
            assert len(record_data) == data_length
        except AssertionError:
            log.debug("buffer underflow at offset {0}".format(f.tell()))
            raise LengthError("insufficient data to parse")

        if tnf in (0, 5, 6) and len(record_type) > 0:
            s = "ndef type name format {0} doesn't allow a type string"
            raise FormatError( s.format(tnf) )
        if tnf in (1, 2, 3, 4) and len(record_type) == 0:
            s = "ndef type name format {0} requires a type string"
            raise FormatError( s.format(tnf) )
        if tnf == 0 and len(record_data) > 0:
            s = "ndef type name format {0} doesn't allow a payload"
            raise FormatError( s.format(tnf) )
            
        self._message_begin, self._message_end = mbf, mef
        self._type = bytearray(type_name_prefix[tnf] + record_type)
        self._name = bytearray(record_name)
        self._data = bytearray(record_data)
        log.debug("parsed {0}".format(repr(self)))
1321320
private function readTopMargin()
    {
        $length = self::getInt2d($this->data, $this->pos + 2);
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);

        // move stream pointer to next record
        $this->pos += 4 + $length;

        if (!$this->readDataOnly) {
            // offset: 0; size: 8
            $this->phpSheet->getPageMargins()->setTop(self::extractNumber($recordData));
        }
    }
100091
@Deprecated
  public static long readRecordCount (FileSystem fs, Path dir) throws IOException {
    State state = loadState(fs, dir);

    if (!state.contains(CompactionSlaEventHelper.RECORD_COUNT_TOTAL)) {
      if (fs.exists(new Path (dir, RECORD_COUNT_FILE))){
        try (BufferedReader br = new BufferedReader(new InputStreamReader(fs.open (new Path (dir, RECORD_COUNT_FILE)), Charsets.UTF_8))) {
          long count = Long.parseLong(br.readLine());
          return count;
        }
      } else {
        return 0;
      }
    } else {
      return Long.parseLong(state.getProp(CompactionSlaEventHelper.RECORD_COUNT_TOTAL));
    }
  }
1351926
def read_to_end(self, record=None):
        

        # no current record to read
        if not self.record:
            return None

        # already at end of this record, don't read until it is consumed
        if self.member_info:
            return None

        curr_offset = self.offset

        while True:
            b = self.record.raw_stream.read(BUFF_SIZE)
            if not b:
                break

        """
        - For compressed files, blank lines are consumed
          since they are part of record length
        - For uncompressed files, blank lines are read later,
          and not included in the record length
        """
        #if self.reader.decompressor:
        self.next_line, empty_size = self._consume_blanklines()

        self.offset = self.fh.tell() - self.reader.rem_length()
        #if self.offset < 0:
        #    raise Exception('Not Gzipped Properly')

        if self.next_line:
            self.offset -= len(self.next_line)

        length = self.offset - curr_offset

        if not self.reader.decompressor:
            length -= empty_size

        self.member_info = (curr_offset, length)
1030733
def record(self):
        """"""
        if self.recordmetadata:
            return Record(self.recordmetadata.json, model=self.recordmetadata)
        else:
            return None
666263
def __record(self):
        """"""
        f = self.__getFileObj(self.dbf)
        recFmt = self.__recordFmt()
        recordContents = unpack(recFmt[0], f.read(recFmt[1]))
        if recordContents[0] != b(' '):
            # deleted record
            return None
        record = []
        for (name, typ, size, deci), value in zip(self.fields,
                                                                                                recordContents):
            if name == 'DeletionFlag':
                continue
            elif not value.strip():
                record.append(value)
                continue
            elif typ == "N":
                value = value.replace(b('\0'), b('')).strip()
                if value == b(''):
                    value = 0
                elif deci:
                    try:
                        value = float(value)
                    except ValueError:
                        value = 0
                else:
                    value = int(value)
            elif typ == b('D'):
                try:
                    y, m, d = int(value[:4]), int(value[4:6]), int(value[6:8])
                    value = [y, m, d]
                except:
                    value = value.strip()
            elif typ == b('L'):
                value = (value in b('YyTt') and b('T')) or \
                                        (value in b('NnFf') and b('F')) or b('?')
            else:
                value = u(value)
                value = value.strip()
            record.append(value)
        return record
1006569
private function _readPalette()
	{
		$length = self::_GetInt2d($this->_data, $this->_pos + 2);
		$recordData = substr($this->_data, $this->_pos + 4, $length);

		// move stream pointer to next record
		$this->_pos += 4 + $length;

		if (!$this->_readDataOnly) {
			// offset: 0; size: 2; number of following colors
			$nm = self::_GetInt2d($recordData, 0);

			// list of RGB colors
			for ($i = 0; $i < $nm; ++$i) {
				$rgb = substr($recordData, 2 + 4 * $i, 4);
				$this->_palette[] = self::_readRGB($rgb);
			}
		}
	}
1195644
private void readRecord(byte[] buffer, Table table)
   {
      //System.out.println(ByteArrayHelper.hexdump(buffer, true, 16, ""));
      int deletedFlag = getShort(buffer, 0);
      if (deletedFlag != 0)
      {
         Map<String, Object> row = new HashMap<String, Object>();
         for (ColumnDefinition column : m_definition.getColumns())
         {
            Object value = column.read(0, buffer);
            //System.out.println(column.getName() + ": " + value);
            row.put(column.getName(), value);
         }

         table.addRow(m_definition.getPrimaryKeyColumnName(), row);
      }
   }
418943
public void printEndRecordData(Rec record, PrintWriter out, int iPrintOptions)
    {
        String strRecordName = record.getTableNames(false);
        if ((strRecordName == null) || (strRecordName.length() == 0))
        	strRecordName = "Record";
        out.println(Utility.endTag(strRecordName));
    }
1336076
def currentRecord(self):
        
        item = self.currentItem()
        if isinstance(item, XOrbRecordItem):
            return item.record()
        return None
536845
def read_record(self, dtype, shape=1, byteorder=None):
        """"""
        rec = numpy.rec
        try:
            record = rec.fromfile(self._fh, dtype, shape, byteorder=byteorder)
        except Exception:
            dtype = numpy.dtype(dtype)
            if shape is None:
                shape = self._size // dtype.itemsize
            size = product(sequence(shape)) * dtype.itemsize
            data = self._fh.read(size)
            record = rec.fromstring(data, dtype, shape, byteorder=byteorder)
        return record[0] if shape == 1 else record
93126
private function readPane()
    {
        $length = self::getInt2d($this->data, $this->pos + 2);
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);

        // move stream pointer to next record
        $this->pos += 4 + $length;

        if (!$this->readDataOnly) {
            // offset: 0; size: 2; position of vertical split
            $px = self::getInt2d($recordData, 0);

            // offset: 2; size: 2; position of horizontal split
            $py = self::getInt2d($recordData, 2);

            if ($this->frozen) {
                // frozen panes
                $this->phpSheet->freezePane(PHPExcel_Cell::stringFromColumnIndex($px) . ($py + 1));
            } else {
                // unfrozen panes; split windows; not supported by PHPExcel core
            }
        }
    }
959568
public void readRecordClass(String strRecordClass)
    {
        String strBaseClass;
        Record recClassInfo = this.getMainRecord();
        if (!this.readThisClass(strRecordClass))
            strBaseClass = "Record";
        else
        {
            strBaseClass = recClassInfo.getField(ClassInfo.BASE_CLASS_NAME).getString();
            if (strBaseClass.equalsIgnoreCase("Record"))
                strBaseClass = "Record";
            if (strBaseClass.length() == 0)
                strBaseClass = "Record";
        }
        recClassInfo.getField(ClassInfo.BASE_CLASS_NAME).setString(strBaseClass);
    }
758563
private java.io.DataInputStream readNextLogRecord()
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "readNextLogRecord",
                        new Object[] { new Long(sectorValidatedInputStream.currentPage),
                                      new Integer(sectorValidatedInputStream.currentByte) });

        byte[] logRecordBytes = null;
        short partLength = 0;
        byte partType = FileLogOutput.PART_First;
        byte multiPartID = 0;
        java.io.DataInputStream logRecordDataInputStream = null;

        // Keep reading until we have assembled a complete LogRecord.
        while (logRecordDataInputStream == null) {
            try {
                // Read the part header.
                partType = dataInputStream.readByte();
                switch (partType) {
                    case FileLogOutput.PART_Padding:
                        // Padding, do nothing.
                        break;

                    case FileLogOutput.PART_First:
                    case FileLogOutput.PART_Middle:
                    case FileLogOutput.PART_Last:
                        multiPartID = dataInputStream.readByte();
                        partLength = dataInputStream.readShort();

                        // Now get the logRecord itself.
                        // TODO We could avoid doing this if the logRecord is single part as it is in fact just the next bytes
                        //      in the datastream.
                        logRecordBytes = new byte[partLength];
                        // There is a bug in JVM 1.4.2 such that dataInput.readFully(byte[],int,int)
                        // returns a partial buffer rather than throwing EOFExcepton. 
                        // dataInputStream.readFully(logRecordBytes);
                        // Anyhow we would rather not block if the file has data missing at the end.
                        int bytesRead = dataInputStream.read(logRecordBytes);
                        if (bytesRead != partLength) {
                            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                                trace.exit(this, cclass
                                           , "readNextLogRecord"
                                           , new Object[] { "LogFileExhausted_1", new Integer(bytesRead), new Short(partLength) }
                                                );
                            throw new LogFileExhaustedException(this, new java.io.EOFException());
                        } // if ( bytesRead != partLength).

                        if (multiPartID == 0) {
                            // partType will be PART_Last, this is the only part.
                            java.io.ByteArrayInputStream byteArrayInputStream = new java.io.ByteArrayInputStream(logRecordBytes);
                            logRecordDataInputStream = new java.io.DataInputStream(byteArrayInputStream);

                        } else if (partType == FileLogOutput.PART_Last) {
                            if (multiPartLogRecords[multiPartID] != null) {
                                multiPartLogRecords[multiPartID].add(logRecordBytes);
                                MultiByteArrayInputStream inputStream = new MultiByteArrayInputStream(multiPartLogRecords[multiPartID]);
                                logRecordDataInputStream = new java.io.DataInputStream(inputStream);
                                multiPartLogRecords[multiPartID] = null;
                            } // if (multiPartLogRecords[multiPartID] != null).

                        } else if (partType == FileLogOutput.PART_First) {
                            multiPartLogRecords[multiPartID] = new java.util.ArrayList();
                            multiPartLogRecords[multiPartID].add(logRecordBytes);
                        } else {
                            if (multiPartLogRecords[multiPartID] != null) {
                                multiPartLogRecords[multiPartID].add(logRecordBytes);
                            }
                        }

                        break;
                    default:
                        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                            trace.exit(this, cclass
                                       , "readNextLogRecord"
                                       , "via InvalidLogPartTypeException partType=" + partType + "(byte)"
                                            );
                        throw new InvalidLogRecordPartTypeException(this
                                                                    , partType);
                        // break;                             // unreachable.
                } // switch (partType).

            } catch (java.io.EOFException exception) {
                // No FFDC Code Needed, condition expected when end of log seen.
                if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                    trace.exit(this, cclass
                               , "readNextLogRecord"
                               , new Object[] { "LogFileExhausted_2", new Short(partLength) }
                                    );
                throw new LogFileExhaustedException(this, exception);

            } catch (java.io.IOException exception) {
                // No FFDC Code Needed.
                ObjectManager.ffdc.processException(cclass, "readNext", exception, "1:348:1.13");

                if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                    trace.exit(this, cclass
                               , "readNextLogRecord"
                               , new Object[] { new Short(partLength), exception }
                                    );
                throw new PermanentIOException(this
                                               , exception);
            } // catch java.io.IOException.

        } // while (logRecordDataInputStream == null).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "readNextLogRecord",
                       new Object[] { logRecordDataInputStream });
        return logRecordDataInputStream;
    }
275032
def _parse_record_line(record_line):
    
    # Dictionary for record fields
    record_fields = {}

    # Read string fields from record line
    (record_fields['record_name'], record_fields['n_seg'],
     record_fields['n_sig'], record_fields['fs'],
     record_fields['counter_freq'], record_fields['base_counter'],
     record_fields['sig_len'], record_fields['base_time'],
     record_fields['base_date']) = re.findall(_rx_record, record_line)[0]

    for field in RECORD_SPECS.index:
        # Replace empty strings with their read defaults (which are
        # mostly None)
        if record_fields[field] == '':
            record_fields[field] = RECORD_SPECS.loc[field, 'read_default']
        # Typecast non-empty strings for non-string (numerical/datetime)
        # fields
        else:
            if RECORD_SPECS.loc[field, 'allowed_types'] == int_types:
                record_fields[field] = int(record_fields[field])
            elif RECORD_SPECS.loc[field, 'allowed_types'] == float_types:
                record_fields[field] = float(record_fields[field])
                # cast fs to an int if it is close
                if field == 'fs':
                    fs = float(record_fields['fs'])
                    if round(fs, 8) == float(int(fs)):
                        fs = int(fs)
                    record_fields['fs'] = fs
            elif field == 'base_time':
                record_fields['base_time'] = wfdb_strptime(record_fields['base_time'])
            elif field == 'base_date':
                record_fields['base_date'] = datetime.datetime.strptime(
                    record_fields['base_date'], '%d/%m/%Y').date()

    # This is not a standard wfdb field, but is useful to set.
    if record_fields['base_date'] and record_fields['base_time']:
        record_fields['base_datetime'] = datetime.datetime.combine(
            record_fields['base_date'], record_fields['base_time'])

    return record_fields