Reads column-specific data like blobs from the checkpoint.

Returns -1 if the data does not fit into the current block.
490704
int readCheckpoint(ReadStream is, 
                     byte[] blockBuffer,
                     int rowOffset,
                     int blobTail)
    throws IOException
  {
    int rowLength = length();
    
    if (rowOffset < blobTail) {
      return -1;
    }
    
    for (Column column : columns()) {
      blobTail = column.readCheckpoint(is, 
                                       blockBuffer, 
                                       rowOffset, rowLength, 
                                       blobTail);
    }
    
    return blobTail;
  }
649271
def readline(self, size=-1):
        
        remainder = int(self.length) - self.__position
        if size < 0 or size > remainder:
            size = remainder

        if size == 0:
            return EMPTY

        received = 0
        data = StringIO()
        while received < size:
            chunk_data = self.readchunk()
            pos = chunk_data.find(NEWLN, 0, size)
            if pos != -1:
                size = received + pos + 1

            received += len(chunk_data)
            data.write(chunk_data)
            if pos != -1:
                break

        self.__position -= received - size

        # Return 'size' bytes and store the rest.
        data.seek(size)
        self.__buffer = data.read()
        data.seek(0)
        return data.read(size)
536389
@Override
  public int read(byte[] b, int start, int length) throws IOException {
    if (!readMetaDataIfNeeded()) {
      return -1;
    }
    int toRead = (int)Math.min(length, getCompleteBlockSize() - rawBlockOffset);
    int read = in.read(b, start, toRead);
    if (read >= 0) {
      moveForward(read);
    } else {
      eofReached = true;
    }
    return read;
  }
53137
public int read() throws java.io.IOException {
    checkClosed();
    try {
      if (limit > 0 && apos >= limit) {
        return -1;
      }
      if (buffer == null || bpos >= buffer.length) {
        buffer = lo.read(bsize);
        bpos = 0;
      }

      // Handle EOF
      if (bpos >= buffer.length) {
        return -1;
      }

      int ret = (buffer[bpos] & 0x7F);
      if ((buffer[bpos] & 0x80) == 0x80) {
        ret |= 0x80;
      }

      bpos++;
      apos++;

      return ret;
    } catch (SQLException se) {
      throw new IOException(se.toString());
    }
  }
1076799
private int readBlock() {
        blockSize = read();
        int n = 0;
        if (blockSize > 0) {
            int count = 0;
            try {
                while (n < blockSize) {
                    count = blockSize - n;
                    rawData.get(block, n, count);

                    n += count;
                }
            } catch (Exception e) {
//                if (Log.isLoggable(TAG, Log.DEBUG)) {
//                    Log.d(TAG,
//                            "Error Reading Block n: " + n + " count: " + count + " blockSize: " + blockSize, e);
//                }
                header.status = GifDecoder.STATUS_FORMAT_ERROR;
            }
        }
        return n;
    }
63669
private void readBlock() throws IOException {
    int blockSize = readInt(in);
    final boolean compressed = (blockSize & LZ4FrameOutputStream.LZ4_FRAME_INCOMPRESSIBLE_MASK) == 0;
    blockSize &= ~LZ4FrameOutputStream.LZ4_FRAME_INCOMPRESSIBLE_MASK;

    // Check for EndMark
    if (blockSize == 0) {
      if (frameInfo.isEnabled(LZ4FrameOutputStream.FLG.Bits.CONTENT_CHECKSUM)) {
        final int contentChecksum = readInt(in);
        if (contentChecksum != frameInfo.currentStreamHash()) {
          throw new IOException("Content checksum mismatch");
        }
      }
      if (frameInfo.isEnabled(LZ4FrameOutputStream.FLG.Bits.CONTENT_SIZE) && expectedContentSize != totalContentSize) {
	throw new IOException("Size check mismatch");
      }
      frameInfo.finish();
      return;
    }

    final byte[] tmpBuffer; // Use a temporary buffer, potentially one used for compression
    if (compressed) {
      tmpBuffer = compressedBuffer;
    } else {
      tmpBuffer = rawBuffer;
    }
    if (blockSize > maxBlockSize) {
      throw new IOException(String.format(Locale.ROOT, "Block size %s exceeded max: %s", blockSize, maxBlockSize));
    }

    int offset = 0;
    while (offset < blockSize) {
      final int lastRead = in.read(tmpBuffer, offset, blockSize - offset);
      if (lastRead < 0) {
        throw new IOException(PREMATURE_EOS);
      }
      offset += lastRead;
    }

    // verify block checksum
    if (frameInfo.isEnabled(LZ4FrameOutputStream.FLG.Bits.BLOCK_CHECKSUM)) {
      final int hashCheck = readInt(in);
      if (hashCheck != checksum.hash(tmpBuffer, 0, blockSize, 0)) {
        throw new IOException(BLOCK_HASH_MISMATCH);
      }
    }

    final int currentBufferSize;
    if (compressed) {
      try {
        currentBufferSize = decompressor.decompress(tmpBuffer, 0, blockSize, rawBuffer, 0, rawBuffer.length);
      } catch (LZ4Exception e) {
        throw new IOException(e);
      }
    } else {
      currentBufferSize = blockSize;
    }
    if (frameInfo.isEnabled(LZ4FrameOutputStream.FLG.Bits.CONTENT_CHECKSUM)) {
      frameInfo.updateStreamHash(rawBuffer, 0, currentBufferSize);
    }
    totalContentSize += currentBufferSize;
    buffer.limit(currentBufferSize);
    buffer.rewind();
  }
37128
public int read() {
        while (rleRepeat < 1) {
            if (bwtBytesDecoded == bwtBlockLength) {
                return -1;
            }

            int nextByte = decodeNextBWTByte();
            if (nextByte != rleLastDecodedByte) {
                // New byte, restart accumulation
                rleLastDecodedByte = nextByte;
                rleRepeat = 1;
                rleAccumulator = 1;
                crc.updateCRC(nextByte);
            } else {
                if (++rleAccumulator == 4) {
                    // Accumulation complete, start repetition
                    int rleRepeat = decodeNextBWTByte() + 1;
                    this.rleRepeat = rleRepeat;
                    rleAccumulator = 0;
                    crc.updateCRC(nextByte, rleRepeat);
                } else {
                    rleRepeat = 1;
                    crc.updateCRC(nextByte);
                }
            }
        }
        rleRepeat--;

        return rleLastDecodedByte;
    }
389684
private int readCorner2(int numRows, int numColumns) {
    int currentByte = 0;
    if (readModule(numRows - 3, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 2, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(numRows - 1, 0, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 4, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 3, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 2, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(0, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    currentByte <<= 1;
    if (readModule(1, numColumns - 1, numRows, numColumns)) {
      currentByte |= 1;
    }
    return currentByte;
  }
363537
def read(self, n=-1):
        

        buf = b''
        while n < 0 or n is None or n > len(buf):
            data = self.read1(n)
            if len(data) == 0:
                return buf

            buf += data

        return buf
387339
def read(self, n=1):
        
        self.offset += n
        return self.data[self.offset - n:self.offset]
1193386
def read_bytes(self):
		
		global exit_flag

		for self.i in range(0, self.length) :
			self.bytes[self.i] = i_max[self.i]
			self.maxbytes[self.i] = total_chunks[self.i]
			self.progress[self.i]["maximum"] = total_chunks[self.i]
			self.progress[self.i]["value"] = self.bytes[self.i]
			self.str[self.i].set(file_name[self.i]+ "       " + str(self.bytes[self.i]) 
								  + "KB / " + str(int(self.maxbytes[self.i] + 1)) + " KB")

		if exit_flag == self.length:
			exit_flag = 0
			self.frame.destroy()
		else:
			self.frame.after(10, self.read_bytes)
231386
private void read_block_sizes_from_disk(boolean coalesce_blocks)
    throws IOException
    {
        long addr = FIRST_TAIL;
        int length;
        long new_tail = tail_ptr;

        while (addr < tail_ptr) {
            seek(addr);
            if (coalesce_blocks) {
                length = combine_blocks(addr);
            } else {
                length = readInt();
            }
            if (length > 0) {
                if ((length + addr >= tail_ptr) && (!readOnly)) {
                    // add last block to tail
                    new_tail = addr;
                } else {
                    add_to_freelist(addr, length);
                }
            } else {
                length = - length;
                allocated_blocks++;
                allocated_words += length;
            }
            addr = addr + length;
        }
        if ((new_tail != tail_ptr) && (!readOnly)) {
            tail_ptr = new_tail;
            seek(TAIL_DPTR);
            writeLong(tail_ptr);
        }

    }
889212
@Override
	public int read(byte[] b, int off, int len) throws IOException {
		if (currentEntry != null) {
			if (currentFileSize == currentEntry.getSize()) {
				return -1;
			} else if ((currentEntry.getSize() - currentFileSize) < len) {
				len = (int) (currentEntry.getSize() - currentFileSize);
			}
		}

		int br = super.read(b, off, len);

		if (br != -1) {
			if (currentEntry != null) {
				currentFileSize += br;
			}

			bytesRead += br;
		}

		return br;
	}
426726
public int readShortBE() throws IOException {
        int h = read();
        int l = read();
        if (-1 == h || -1 == l)
            return -1;
        return DataUtils.toShort(h, l);
    }
1235079
def _read_bin(self, stream, byte_order):
        '''
        

        '''
        try:
            return _read_array(stream, self.dtype(byte_order), 1)[0]
        except IndexError:
            raise StopIteration
303751
public int readWithChecksum(byte[] b, int off, int len) throws IOException {

    if (currentOffset == length) {
      return -1;
    }
    else if (currentOffset >= dataLength) {
      // If the previous read drained off all the data, then just return
      // the checksum now. Note that checksum validation would have 
      // happened in the earlier read
      int lenToCopy = (int) (checksumSize - (currentOffset - dataLength));
      if (len < lenToCopy) {
        lenToCopy = len;
      }
      System.arraycopy(csum, (int) (currentOffset - dataLength), b, off, 
          lenToCopy);
      currentOffset += lenToCopy;
      return lenToCopy;
    }

    int bytesRead = doRead(b,off,len);

    if (currentOffset == dataLength) {
      if (len >= bytesRead + checksumSize) {
        System.arraycopy(csum, 0, b, off + bytesRead, checksumSize);
        bytesRead += checksumSize;
        currentOffset += checksumSize;
      }
    }
    return bytesRead;
  }
409122
def read(self, n=-1):
        
        if n is None or n < 0:
            buf = self._readbuffer[self._offset:]
            self._readbuffer = b''
            self._offset = 0
            while not self._eof:
                buf += self._read1(self.MAX_N)
            return buf

        end = n + self._offset
        if end < len(self._readbuffer):
            buf = self._readbuffer[self._offset:end]
            self._offset = end
            return buf

        n = end - len(self._readbuffer)
        buf = self._readbuffer[self._offset:]
        self._readbuffer = b''
        self._offset = 0
        while n > 0 and not self._eof:
            data = self._read1(n)
            if n < len(data):
                self._readbuffer = data
                self._offset = n
                buf += data[:n]
                break
            buf += data
            n -= len(data)
        return buf