Read COLINFO record
332240
private function readColInfo()
    {
        $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; index to first column in range
            $fc = self::getInt2d($recordData, 0); // first column index

            // offset: 2; size: 2; index to last column in range
            $lc = self::getInt2d($recordData, 2); // first column index

            // offset: 4; size: 2; width of the column in 1/256 of the width of the zero character
            $width = self::getInt2d($recordData, 4);

            // offset: 6; size: 2; index to XF record for default column formatting
            $xfIndex = self::getInt2d($recordData, 6);

            // offset: 8; size: 2; option flags
            // bit: 0; mask: 0x0001; 1= columns are hidden
            $isHidden = (0x0001 & self::getInt2d($recordData, 8)) >> 0;

            // bit: 10-8; mask: 0x0700; outline level of the columns (0 = no outline)
            $level = (0x0700 & self::getInt2d($recordData, 8)) >> 8;

            // bit: 12; mask: 0x1000; 1 = collapsed
            $isCollapsed = (0x1000 & self::getInt2d($recordData, 8)) >> 12;

            // offset: 10; size: 2; not used

            for ($i = $fc; $i <= $lc; ++$i) {
                if ($lc == 255 || $lc == 256) {
                    $this->phpSheet->getDefaultColumnDimension()->setWidth($width / 256);
                    break;
                }
                $this->phpSheet->getColumnDimensionByColumn($i)->setWidth($width / 256);
                $this->phpSheet->getColumnDimensionByColumn($i)->setVisible(!$isHidden);
                $this->phpSheet->getColumnDimensionByColumn($i)->setOutlineLevel($level);
                $this->phpSheet->getColumnDimensionByColumn($i)->setCollapsed($isCollapsed);
                $this->phpSheet->getColumnDimensionByColumn($i)->setXfIndex($this->mapCellXfIndex[$xfIndex]);
            }
        }
    }
296525
function parse_ColInfo(blob, length, opts) {
	if(!opts.cellStyles) return parsenoop(blob, length);
	var w = opts && opts.biff >= 12 ? 4 : 2;
	var colFirst = blob.read_shift(w);
	var colLast = blob.read_shift(w);
	var coldx = blob.read_shift(w);
	var ixfe = blob.read_shift(w);
	var flags = blob.read_shift(2);
	if(w == 2) blob.l += 2;
	return {s:colFirst, e:colLast, w:coldx, ixfe:ixfe, flags:flags};
}
609284
private function _readRow()
	{
		$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; index of this row
			$r = self::_GetInt2d($recordData, 0);

			// offset: 2; size: 2; index to column of the first cell which is described by a cell record

			// offset: 4; size: 2; index to column of the last cell which is described by a cell record, increased by 1

			// offset: 6; size: 2;

			// bit: 14-0; mask: 0x7FFF; height of the row, in twips = 1/20 of a point
			$height = (0x7FFF & self::_GetInt2d($recordData, 6)) >> 0;

			// bit: 15: mask: 0x8000; 0 = row has custom height; 1= row has default height
			$useDefaultHeight = (0x8000 & self::_GetInt2d($recordData, 6)) >> 15;

			if (!$useDefaultHeight) {
				$this->_phpSheet->getRowDimension($r + 1)->setRowHeight($height / 20);
			}

			// offset: 8; size: 2; not used

			// offset: 10; size: 2; not used in BIFF5-BIFF8

			// offset: 12; size: 4; option flags and default row formatting

			// bit: 2-0: mask: 0x00000007; outline level of the row
			$level = (0x00000007 & self::_GetInt4d($recordData, 12)) >> 0;
			$this->_phpSheet->getRowDimension($r + 1)->setOutlineLevel($level);

			// bit: 4; mask: 0x00000010; 1 = outline group start or ends here... and is collapsed
			$isCollapsed = (0x00000010 & self::_GetInt4d($recordData, 12)) >> 4;
			$this->_phpSheet->getRowDimension($r + 1)->setCollapsed($isCollapsed);

			// bit: 5; mask: 0x00000020; 1 = row is hidden
			$isHidden = (0x00000020 & self::_GetInt4d($recordData, 12)) >> 5;
			$this->_phpSheet->getRowDimension($r + 1)->setVisible(!$isHidden);

			// bit: 7; mask: 0x00000080; 1 = row has explicit format
			$hasExplicitFormat = (0x00000080 & self::_GetInt4d($recordData, 12)) >> 7;

			// bit: 27-16; mask: 0x0FFF0000; only applies when hasExplicitFormat = 1; index to XF record
			$xfIndex = (0x0FFF0000 & self::_GetInt4d($recordData, 12)) >> 16;

			if ($hasExplicitFormat) {
				$this->_phpSheet->getRowDimension($r + 1)->setXfIndex($this->_mapCellXfIndex[$xfIndex]);
			}
		}
	}
386664
def peek(self):
        
        records = self._records
        if records:
            return records[0]
        if not self.attached():
            return None
        if self.attached():
            self._session.send()
        while self.attached() and not records:
            self._session.fetch()
            if records:
                return records[0]
        return None
1300361
private static ReadableLogRecord read(ByteBuffer viewBuffer, long expectedSequenceNumber, ByteBuffer sourceBuffer)
  {
    ReadableLogRecord logRecord = null;
    int absolutePosition = sourceBuffer.position() + viewBuffer.position();
    
    // Read the record magic number field.
    final byte[] magicNumberBuffer = new byte[RECORD_MAGIC_NUMBER.length];
    
    viewBuffer.get(magicNumberBuffer);        
    
    int recordLength = 0;
            
    if (Arrays.equals(magicNumberBuffer, RECORD_MAGIC_NUMBER))
    {
      long recordSequenceNumber = viewBuffer.getLong(); 
      
      if (recordSequenceNumber >= expectedSequenceNumber)
      {
        // The record sequence is consistent with the expected sequence number supplied by the
        // caller. So skip over the actual log record data in this record so that
        // we can check the tail sequence number.
        recordLength = viewBuffer.getInt();
      
        // Preserve the current byte cursor position so that we can reset back to it later. 
        // Move the byte cursor to the first byte after the record data.
        final int recordDataPosition = viewBuffer.position();                                                
        viewBuffer.position(recordDataPosition + recordLength);

        // Read the repeated record sequence number
        final long tailSequenceNumber = viewBuffer.getLong();
    
        // Because are are only looking for sequence numbers larger than expected the only assurance that we
        // have not read garbage following the magic number is that the first and tail sequence numbers are equal.
        
        // Note its still possible garbage is in the data but that can't be helped without changing the log format.
        // It will be discovered later no doubt!
        if (tailSequenceNumber == recordSequenceNumber)
        {
          // Return the buffer's pointer to the start of
          // the record's data prior to creating a new
          // ReadableLogRecord to return to the caller.
          viewBuffer.position(recordDataPosition);
          
          logRecord = new ReadableLogRecord(viewBuffer, absolutePosition, tailSequenceNumber); 
          
          // Advance the original buffer's position to the end of this record. This ensures that
          // the next ReadableLogRecord or WritableLogRecord constructed will read or write the
          // next record in the file.
          sourceBuffer.position(absolutePosition + HEADER_SIZE + recordLength);    
        }
      }
    }
    
    return logRecord;       
  }
1328170
protected function readNextRecord()
    {
        $depth = 0;
        $isInRecord = false;
        $record = '';

        while (false !== ($char = fgetc($this->handle))) {
            if ($char === '{') {
                ++$depth;
            }
            if ($char === '}') {
                --$depth;
            }

            if (!$isInRecord && $char === '{') {
                $isInRecord = true;
            }

            if ($isInRecord) {
                $record .= $char;
            }

            if ($isInRecord && $char === '}' && $depth == 0) {
                break;
            }
        }

        if ($char == false) {
            $this->isEOF = true;
        }

        return $record;
    }
1049953
private function _readImData()
	{
		$length = self::_GetInt2d($this->_data, $this->_pos + 2);

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

		// UNDER CONSTRUCTION

		// offset: 0; size: 2; image format
		$cf = self::_GetInt2d($recordData, 0);

		// offset: 2; size: 2; environment from which the file was written
		$env = self::_GetInt2d($recordData, 2);

		// offset: 4; size: 4; length of the image data
		$lcb = self::_GetInt4d($recordData, 4);

		// offset: 8; size: var; image data
		$iData = substr($recordData, 8);

		switch ($cf) {
		case 0x09: // Windows bitmap format
			// BITMAPCOREINFO
			// 1. BITMAPCOREHEADER
			// offset: 0; size: 4; bcSize, Specifies the number of bytes required by the structure
			$bcSize = self::_GetInt4d($iData, 0);
//			var_dump($bcSize);

			// offset: 4; size: 2; bcWidth, specifies the width of the bitmap, in pixels
			$bcWidth = self::_GetInt2d($iData, 4);
//			var_dump($bcWidth);

			// offset: 6; size: 2; bcHeight, specifies the height of the bitmap, in pixels.
			$bcHeight = self::_GetInt2d($iData, 6);
//			var_dump($bcHeight);
			$ih = imagecreatetruecolor($bcWidth, $bcHeight);

			// offset: 8; size: 2; bcPlanes, specifies the number of planes for the target device. This value must be 1

			// offset: 10; size: 2; bcBitCount specifies the number of bits-per-pixel. This value must be 1, 4, 8, or 24
			$bcBitCount = self::_GetInt2d($iData, 10);
//			var_dump($bcBitCount);

			$rgbString = substr($iData, 12);
			$rgbTriples = array();
			while (strlen($rgbString) > 0) {
				$rgbTriples[] = unpack('Cb/Cg/Cr', $rgbString);
				$rgbString = substr($rgbString, 3);
			}
			$x = 0;
			$y = 0;
			foreach ($rgbTriples as $i => $rgbTriple) {
				$color = imagecolorallocate($ih, $rgbTriple['r'], $rgbTriple['g'], $rgbTriple['b']);
				imagesetpixel($ih, $x, $bcHeight - 1 - $y, $color);
				$x = ($x + 1) % $bcWidth;
				$y = $y + floor(($x + 1) / $bcWidth);
			}
			//imagepng($ih, 'image.png');

			$drawing = new PHPExcel_Worksheet_Drawing();
			$drawing->setPath($filename);
			$drawing->setWorksheet($this->_phpSheet);

			break;

		case 0x02: // Windows metafile or Macintosh PICT format
		case 0x0e: // native format
		default;
			break;

		}

		// _getSplicedRecordData() takes care of moving current position in data stream
	}
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);
			}
		}
	}
362774
private function readTextObject()
    {
        $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) {
            return;
        }

        // recordData consists of an array of subrecords looking like this:
        //    grbit: 2 bytes; Option Flags
        //    rot: 2 bytes; rotation
        //    cchText: 2 bytes; length of the text (in the first continue record)
        //    cbRuns: 2 bytes; length of the formatting (in the second continue record)
        // followed by the continuation records containing the actual text and formatting
        $grbitOpts  = self::getInt2d($recordData, 0);
        $rot        = self::getInt2d($recordData, 2);
        $cchText    = self::getInt2d($recordData, 10);
        $cbRuns     = self::getInt2d($recordData, 12);
        $text       = $this->getSplicedRecordData();

        $this->textObjects[$this->textObjRef] = array(
            'text'      => substr($text["recordData"], $text["spliceOffsets"][0]+1, $cchText),
            'format'    => substr($text["recordData"], $text["spliceOffsets"][1], $cbRuns),
            'alignment' => $grbitOpts,
            'rotation'  => $rot
        );

//        echo '<b>_readTextObject()</b><br />';
//        var_dump($this->textObjects[$this->textObjRef]);
//        echo '<br />';
    }
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
598564
public boolean readRecord() throws IOException {
		checkClosed();

		columnsCount = 0;
		rawBuffer.Position = 0;

		dataBuffer.LineStart = dataBuffer.Position;

		hasReadNextLine = false;

		// check to see if we've already found the end of data

		if (hasMoreData) {
			// loop over the data stream until the end of data is found
			// or the end of the record is found

			do {
				if (dataBuffer.Position == dataBuffer.Count) {
					checkDataLength();
				} else {
					startedWithQualifier = false;

					// grab the current letter as a char

					char currentLetter = dataBuffer.Buffer[dataBuffer.Position];

					if (userSettings.UseTextQualifier
							&& currentLetter == userSettings.TextQualifier) {
						// this will be a text qualified column, so
						// we need to set startedWithQualifier to make it
						// enter the seperate branch to handle text
						// qualified columns

						lastLetter = currentLetter;

						// read qualified
						startedColumn = true;
						dataBuffer.ColumnStart = dataBuffer.Position + 1;
						startedWithQualifier = true;
						boolean lastLetterWasQualifier = false;

						char escapeChar = userSettings.TextQualifier;

						if (userSettings.EscapeMode == ESCAPE_MODE_BACKSLASH) {
							escapeChar = Letters.BACKSLASH;
						}

						boolean eatingTrailingJunk = false;
						boolean lastLetterWasEscape = false;
						boolean readingComplexEscape = false;
						int escape = ComplexEscape.UNICODE;
						int escapeLength = 0;
						char escapeValue = (char) 0;

						dataBuffer.Position++;

						do {
							if (dataBuffer.Position == dataBuffer.Count) {
								checkDataLength();
							} else {
								// grab the current letter as a char

								currentLetter = dataBuffer.Buffer[dataBuffer.Position];

								if (eatingTrailingJunk) {
									dataBuffer.ColumnStart = dataBuffer.Position + 1;

									if (currentLetter == userSettings.Delimiter) {
										endColumn();
									} else if ((!useCustomRecordDelimiter && (currentLetter == Letters.CR || currentLetter == Letters.LF))
											|| (useCustomRecordDelimiter && currentLetter == userSettings.RecordDelimiter)) {
										endColumn();

										endRecord();
									}
								} else if (readingComplexEscape) {
									escapeLength++;

									switch (escape) {
									case ComplexEscape.UNICODE:
										escapeValue *= (char) 16;
										escapeValue += hexToDec(currentLetter);

										if (escapeLength == 4) {
											readingComplexEscape = false;
										}

										break;
									case ComplexEscape.OCTAL:
										escapeValue *= (char) 8;
										escapeValue += (char) (currentLetter - '0');

										if (escapeLength == 3) {
											readingComplexEscape = false;
										}

										break;
									case ComplexEscape.DECIMAL:
										escapeValue *= (char) 10;
										escapeValue += (char) (currentLetter - '0');

										if (escapeLength == 3) {
											readingComplexEscape = false;
										}

										break;
									case ComplexEscape.HEX:
										escapeValue *= (char) 16;
										escapeValue += hexToDec(currentLetter);

										if (escapeLength == 2) {
											readingComplexEscape = false;
										}

										break;
									}

									if (!readingComplexEscape) {
										appendLetter(escapeValue);
									} else {
										dataBuffer.ColumnStart = dataBuffer.Position + 1;
									}
								} else if (currentLetter == userSettings.TextQualifier) {
									if (lastLetterWasEscape) {
										lastLetterWasEscape = false;
										lastLetterWasQualifier = false;
									} else {
										updateCurrentValue();

										if (userSettings.EscapeMode == ESCAPE_MODE_DOUBLED) {
											lastLetterWasEscape = true;
										}

										lastLetterWasQualifier = true;
									}
								} else if (userSettings.EscapeMode == ESCAPE_MODE_BACKSLASH
										&& lastLetterWasEscape) {
									switch (currentLetter) {
									case 'n':
										appendLetter(Letters.LF);
										break;
									case 'r':
										appendLetter(Letters.CR);
										break;
									case 't':
										appendLetter(Letters.TAB);
										break;
									case 'b':
										appendLetter(Letters.BACKSPACE);
										break;
									case 'f':
										appendLetter(Letters.FORM_FEED);
										break;
									case 'e':
										appendLetter(Letters.ESCAPE);
										break;
									case 'v':
										appendLetter(Letters.VERTICAL_TAB);
										break;
									case 'a':
										appendLetter(Letters.ALERT);
										break;
									case '0':
									case '1':
									case '2':
									case '3':
									case '4':
									case '5':
									case '6':
									case '7':
										escape = ComplexEscape.OCTAL;
										readingComplexEscape = true;
										escapeLength = 1;
										escapeValue = (char) (currentLetter - '0');
										dataBuffer.ColumnStart = dataBuffer.Position + 1;
										break;
									case 'u':
									case 'x':
									case 'o':
									case 'd':
									case 'U':
									case 'X':
									case 'O':
									case 'D':
										switch (currentLetter) {
										case 'u':
										case 'U':
											escape = ComplexEscape.UNICODE;
											break;
										case 'x':
										case 'X':
											escape = ComplexEscape.HEX;
											break;
										case 'o':
										case 'O':
											escape = ComplexEscape.OCTAL;
											break;
										case 'd':
										case 'D':
											escape = ComplexEscape.DECIMAL;
											break;
										}

										readingComplexEscape = true;
										escapeLength = 0;
										escapeValue = (char) 0;
										dataBuffer.ColumnStart = dataBuffer.Position + 1;

										break;
									default:
										break;
									}

									lastLetterWasEscape = false;

									// can only happen for ESCAPE_MODE_BACKSLASH
								} else if (currentLetter == escapeChar) {
									updateCurrentValue();
									lastLetterWasEscape = true;
								} else {
									if (lastLetterWasQualifier) {
										if (currentLetter == userSettings.Delimiter) {
											endColumn();
										} else if ((!useCustomRecordDelimiter && (currentLetter == Letters.CR || currentLetter == Letters.LF))
												|| (useCustomRecordDelimiter && currentLetter == userSettings.RecordDelimiter)) {
											endColumn();

											endRecord();
										} else {
											dataBuffer.ColumnStart = dataBuffer.Position + 1;

											eatingTrailingJunk = true;
										}

										// make sure to clear the flag for next
										// run of the loop

										lastLetterWasQualifier = false;
									}
								}

								// keep track of the last letter because we need
								// it for several key decisions

								lastLetter = currentLetter;

								if (startedColumn) {
									dataBuffer.Position++;

									if (userSettings.SafetySwitch
											&& dataBuffer.Position
													- dataBuffer.ColumnStart
													+ columnBuffer.Position > 100000) {
										close();

										throw new IOException(
												"Maximum column length of 100,000 exceeded in column "
														+ NumberFormat
																.getIntegerInstance()
																.format(columnsCount)
														+ " in record "
														+ NumberFormat
																.getIntegerInstance()
																.format(currentRecord)
														+ ". Set the SafetySwitch property to false"
														+ " if you're expecting column lengths greater than 100,000 characters to"
														+ " avoid this error.");
									}
								}
							} // end else

						} while (hasMoreData && startedColumn);
					} else if (currentLetter == userSettings.Delimiter) {
						// we encountered a column with no data, so
						// just send the end column

						lastLetter = currentLetter;

						endColumn();
					} else if (useCustomRecordDelimiter
							&& currentLetter == userSettings.RecordDelimiter) {
						// this will skip blank lines
						if (startedColumn || columnsCount > 0
								|| !userSettings.SkipEmptyRecords) {
							endColumn();

							endRecord();
						} else {
							dataBuffer.LineStart = dataBuffer.Position + 1;
						}

						lastLetter = currentLetter;
					} else if (!useCustomRecordDelimiter
							&& (currentLetter == Letters.CR || currentLetter == Letters.LF)) {
						// this will skip blank lines
						if (startedColumn
								|| columnsCount > 0
								|| (!userSettings.SkipEmptyRecords && (currentLetter == Letters.CR || lastLetter != Letters.CR))) {
							endColumn();

							endRecord();
						} else {
							dataBuffer.LineStart = dataBuffer.Position + 1;
						}

						lastLetter = currentLetter;
					} else if (userSettings.UseComments && columnsCount == 0
							&& currentLetter == userSettings.Comment) {
						// encountered a comment character at the beginning of
						// the line so just ignore the rest of the line

						lastLetter = currentLetter;

						skipLine();
					} else if (userSettings.TrimWhitespace
							&& (currentLetter == Letters.SPACE || currentLetter == Letters.TAB)) {
						// do nothing, this will trim leading whitespace
						// for both text qualified columns and non

						startedColumn = true;
						dataBuffer.ColumnStart = dataBuffer.Position + 1;
					} else {
						// since the letter wasn't a special letter, this
						// will be the first letter of our current column

						startedColumn = true;
						dataBuffer.ColumnStart = dataBuffer.Position;
						boolean lastLetterWasBackslash = false;
						boolean readingComplexEscape = false;
						int escape = ComplexEscape.UNICODE;
						int escapeLength = 0;
						char escapeValue = (char) 0;

						boolean firstLoop = true;

						do {
							if (!firstLoop
									&& dataBuffer.Position == dataBuffer.Count) {
								checkDataLength();
							} else {
								if (!firstLoop) {
									// grab the current letter as a char
									currentLetter = dataBuffer.Buffer[dataBuffer.Position];
								}

								if (!userSettings.UseTextQualifier
										&& userSettings.EscapeMode == ESCAPE_MODE_BACKSLASH
										&& currentLetter == Letters.BACKSLASH) {
									if (lastLetterWasBackslash) {
										lastLetterWasBackslash = false;
									} else {
										updateCurrentValue();
										lastLetterWasBackslash = true;
									}
								} else if (readingComplexEscape) {
									escapeLength++;

									switch (escape) {
									case ComplexEscape.UNICODE:
										escapeValue *= (char) 16;
										escapeValue += hexToDec(currentLetter);

										if (escapeLength == 4) {
											readingComplexEscape = false;
										}

										break;
									case ComplexEscape.OCTAL:
										escapeValue *= (char) 8;
										escapeValue += (char) (currentLetter - '0');

										if (escapeLength == 3) {
											readingComplexEscape = false;
										}

										break;
									case ComplexEscape.DECIMAL:
										escapeValue *= (char) 10;
										escapeValue += (char) (currentLetter - '0');

										if (escapeLength == 3) {
											readingComplexEscape = false;
										}

										break;
									case ComplexEscape.HEX:
										escapeValue *= (char) 16;
										escapeValue += hexToDec(currentLetter);

										if (escapeLength == 2) {
											readingComplexEscape = false;
										}

										break;
									}

									if (!readingComplexEscape) {
										appendLetter(escapeValue);
									} else {
										dataBuffer.ColumnStart = dataBuffer.Position + 1;
									}
								} else if (userSettings.EscapeMode == ESCAPE_MODE_BACKSLASH
										&& lastLetterWasBackslash) {
									switch (currentLetter) {
									case 'n':
										appendLetter(Letters.LF);
										break;
									case 'r':
										appendLetter(Letters.CR);
										break;
									case 't':
										appendLetter(Letters.TAB);
										break;
									case 'b':
										appendLetter(Letters.BACKSPACE);
										break;
									case 'f':
										appendLetter(Letters.FORM_FEED);
										break;
									case 'e':
										appendLetter(Letters.ESCAPE);
										break;
									case 'v':
										appendLetter(Letters.VERTICAL_TAB);
										break;
									case 'a':
										appendLetter(Letters.ALERT);
										break;
									case '0':
									case '1':
									case '2':
									case '3':
									case '4':
									case '5':
									case '6':
									case '7':
										escape = ComplexEscape.OCTAL;
										readingComplexEscape = true;
										escapeLength = 1;
										escapeValue = (char) (currentLetter - '0');
										dataBuffer.ColumnStart = dataBuffer.Position + 1;
										break;
									case 'u':
									case 'x':
									case 'o':
									case 'd':
									case 'U':
									case 'X':
									case 'O':
									case 'D':
										switch (currentLetter) {
										case 'u':
										case 'U':
											escape = ComplexEscape.UNICODE;
											break;
										case 'x':
										case 'X':
											escape = ComplexEscape.HEX;
											break;
										case 'o':
										case 'O':
											escape = ComplexEscape.OCTAL;
											break;
										case 'd':
										case 'D':
											escape = ComplexEscape.DECIMAL;
											break;
										}

										readingComplexEscape = true;
										escapeLength = 0;
										escapeValue = (char) 0;
										dataBuffer.ColumnStart = dataBuffer.Position + 1;

										break;
									default:
										break;
									}

									lastLetterWasBackslash = false;
								} else {
									if (currentLetter == userSettings.Delimiter) {
										endColumn();
									} else if ((!useCustomRecordDelimiter && (currentLetter == Letters.CR || currentLetter == Letters.LF))
											|| (useCustomRecordDelimiter && currentLetter == userSettings.RecordDelimiter)) {
										endColumn();

										endRecord();
									}
								}

								// keep track of the last letter because we need
								// it for several key decisions

								lastLetter = currentLetter;
								firstLoop = false;

								if (startedColumn) {
									dataBuffer.Position++;

									if (userSettings.SafetySwitch
											&& dataBuffer.Position
													- dataBuffer.ColumnStart
													+ columnBuffer.Position > 100000) {
										close();

										throw new IOException(
												"Maximum column length of 100,000 exceeded in column "
														+ NumberFormat
																.getIntegerInstance()
																.format(columnsCount)
														+ " in record "
														+ NumberFormat
																.getIntegerInstance()
																.format(currentRecord)
														+ ". Set the SafetySwitch property to false"
														+ " if you're expecting column lengths greater than 100,000 characters to"
														+ " avoid this error.");
									}
								}
							} // end else
						} while (hasMoreData && startedColumn);
					}

					if (hasMoreData) {
						dataBuffer.Position++;
					}
				} // end else
			} while (hasMoreData && !hasReadNextLine);

			// check to see if we hit the end of the file
			// without processing the current record

			if (startedColumn || lastLetter == userSettings.Delimiter) {
				endColumn();

				endRecord();
			}
		}

		if (userSettings.CaptureRawRecord) {
			if (hasMoreData) {
				if (rawBuffer.Position == 0) {
					rawRecord = new String(dataBuffer.Buffer,
							dataBuffer.LineStart, dataBuffer.Position
									- dataBuffer.LineStart - 1);
				} else {
					rawRecord = new String(rawBuffer.Buffer, 0,
							rawBuffer.Position)
							+ new String(dataBuffer.Buffer,
									dataBuffer.LineStart, dataBuffer.Position
											- dataBuffer.LineStart - 1);
				}
			} else {
				// for hasMoreData to ever be false, all data would have had to
				// have been
				// copied to the raw buffer
				rawRecord = new String(rawBuffer.Buffer, 0, rawBuffer.Position);
			}
		} else {
			rawRecord = "";
		}

		return hasReadNextLine;
	}
1206918
public void read(long record, byte[] bytes) throws IOException {
        if (bytes.length != recordSize) {
            final String fmt = "invalid buffer length of %d bytes, expected %d";
            final String msg = format(fmt, bytes.length, recordSize);
            throw new InvalidArgument(msg);
        }

        // (+ recordSize) allows skipping metadata record
        long pos = record * recordSize + recordSize;

        if (pos >= size) {
            final String fmt = "bad seek to position: %d (size is %d)";
            final String msg = format(fmt, pos, size);
            throw new InvalidArgument(msg);
        }

        raf.seek(pos);
        int read = raf.read(bytes);

        if (read != recordSize) {
            final String fmt = "read %d bytes, but expected %d";
            final String msg = format(fmt, read, recordSize);
            throw new InvalidArgument(msg);
        }
    }
413352
def ReadPathInfo(self, client_id, path_type, components, timestamp=None):
    """"""
    try:
      path_record = self.path_records[(client_id, path_type, components)]
      return path_record.GetPathInfo(timestamp=timestamp)
    except KeyError:
      raise db.UnknownPathError(
          client_id=client_id, path_type=path_type, components=components)
1207470
public byte[] readRecord() throws IOException {
        if (this.debug) {
            System.err.println("ReadRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx);
        }

        if (this.inStream == null) {
            throw new IOException("reading from an output buffer");
        }

        if (this.currRecIdx >= this.recsPerBlock) {
            if (!this.readBlock()) {
                return null;
            }
        }

        byte[] result = new byte[this.recordSize];

        System.arraycopy(this.blockBuffer, (this.currRecIdx * this.recordSize), result, 0, this.recordSize);

        this.currRecIdx++;

        return result;
    }
77649
def ReadPathInfos(self, client_id, path_type, components_list):
    """"""
    result = {}

    for components in components_list:
      try:
        path_record = self.path_records[(client_id, path_type, components)]
        result[components] = path_record.GetPathInfo()
      except KeyError:
        result[components] = None

    return result
1336076
def currentRecord(self):
        
        item = self.currentItem()
        if isinstance(item, XOrbRecordItem):
            return item.record()
        return None
99993
private function _readClientAnchor()
	{
		$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
		$recordData = substr($this->_data, $this->_pos + 8, $length);

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

		// offset: 2; size: 2; upper-left corner column index (0-based)
		$c1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 2);

		// offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width
		$startOffsetX = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 4);

		// offset: 6; size: 2; upper-left corner row index (0-based)
		$r1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 6);

		// offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height
		$startOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 8);

		// offset: 10; size: 2; bottom-right corner column index (0-based)
		$c2 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 10);

		// offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width
		$endOffsetX = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 12);

		// offset: 14; size: 2; bottom-right corner row index (0-based)
		$r2 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 14);

		// offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height
		$endOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 16);

		// set the start coordinates
		$this->_object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1) . ($r1 + 1));

		// set the start offsetX
		$this->_object->setStartOffsetX($startOffsetX);

		// set the start offsetY
		$this->_object->setStartOffsetY($startOffsetY);

		// set the end coordinates
		$this->_object->setEndCoordinates(PHPExcel_Cell::stringFromColumnIndex($c2) . ($r2 + 1));

		// set the end offsetX
		$this->_object->setEndOffsetX($endOffsetX);

		// set the end offsetY
		$this->_object->setEndOffsetY($endOffsetY);
	}