Reads from the specified block.

@param blockNumber Internal number of the block in question.
@param blockOffset Offset, in bytes, within this block.
@return The read byte.
338150
public synchronized int read(int blockNumber, int blockOffset) 
			throws IOException {
		long pointer = getBlockOffset(blockNumber) + blockOffset;
		if(mapped == true) {
			MappedByteBuffer map = NikeFS2FileAccessMonitor.instance().requestMap(this);
			map.position((int)pointer);
			int result = map.get();
			return result + 128;
		} else {
			rafile.seek(pointer);
			return rafile.read();
		}
	}
825956
public int read(byte []buf, int offset, int length) throws IOException
  {
    if (_is == null)
      return -1;

    int len = _is.read(buf, offset, length);

    return len;
  }
1369403
public JBBPNumericField findForFieldOffset(final int offset) {
    JBBPNumericField result = null;
    for (final Map.Entry<JBBPNamedFieldInfo, JBBPNumericField> f : fieldMap.entrySet()) {
      if (f.getKey().getFieldOffsetInCompiledBlock() == offset) {
        result = f.getValue();
        break;
      }
    }
    return result;
  }
1127650
public synchronized void write(int blockNumber, int blockOffset, byte[] buffer) 
			throws IOException {
		write(blockNumber, blockOffset, buffer, 0, buffer.length);
	}
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;
    }
714598
public static int getNumValuesPerBlock(int bitsPerValue, int blockSize)
  {
    int ret = 1;
    while (getSerializedSize(bitsPerValue, ret) <= blockSize) {
      ret *= 2;
    }
    return ret / 2;
  }
291046
@Override
	public Number readNumber() {
		int remaining = buf.remaining();
		log.debug("readNumber from {} bytes", remaining);
		// look to see if big enough for double
		if (remaining >= 8) {
			double d = buf.getDouble();
			log.debug("Number: {}", d);
			return d;
		}
		if (log.isDebugEnabled()) {
			log.debug(
					"Remaining not big enough for number - offset: {} limit: {} {}",
					buf.position(), buf.limit(),
					Hex.encodeHexString(buf.array()));
		}
		return 0;
	}
741221
@Override
    public int read (byte[] b, int off, int len) throws IOException {
        if (b == null) {
            throw new NullPointerException();
        } else if (off < 0 || len < 0 || len > b.length - off) {
            throw new IndexOutOfBoundsException();
        } else if (len == 0) {
            return 0;
        }

        int c;
        if (nonBlockingEnabled)
            c = this.read(0L);
        else
            c = in.read();

        if (c == -1) {
            return -1;
        }
        b[off] = (byte)c;
        return 1;
    }
857395
@Override
  public int read(byte[] buffer, int offset, int length) throws IOException
  {
    int b = -1;

    if (_isPartDone)
      return -1;

    int i = 0;
    // Need the last peek or would miss the initial '\n'
    while (_peekOffset + 1 < _peekLength && length > 0) {
      buffer[offset + i++] = _peek[_peekOffset++];
      length--;
    }

    while (i < length && (b = read()) >= 0) {
      boolean hasCr = false;

      if (b == '\r') {
        hasCr = true;
        b = read();

        // XXX: Macintosh?
        if (b != '\n') {
          buffer[offset + i++] = (byte) '\r';
          _peek[0] = (byte) b;
          _peekOffset = 0;
          _peekLength = 1;
          continue;
        }
      }
      else if (b != '\n') {
        buffer[offset + i++] = (byte) b;
        continue;
      }

      int j;
      for (j = 0;
           j < _boundaryLength && (b = read()) >= 0 && _boundaryBuffer[j] == b;
           j++) {
      }

      if (j == _boundaryLength) {
        _isPartDone = true;
        if ((b = read()) == '-') {
          if ((b = read()) == '-') {
            _isDone = true;
            _isComplete = true;
          }
        }

        for (; b > 0 && b != '\r' && b != '\n'; b = read()) {
        }
        if (b == '\r' && (b = read()) != '\n') {
          _peek[0] = (byte) b;
          _peekOffset = 0;
          _peekLength = 1;
        }

        return i > 0 ? i : -1;
      }

      _peekLength = 0;
      if (hasCr && i + 1 < length) {
        buffer[offset + i++] = (byte) '\r';
        buffer[offset + i++] = (byte) '\n';
      }
      else if (hasCr) {
        buffer[offset + i++] = (byte) '\r';
        _peek[_peekLength++] = (byte) '\n';
      }
      else {
        buffer[offset + i++] = (byte) '\n';
      }

      int k = 0;
      while (k < j && i + 1 < length)
        buffer[offset + i++] = _boundaryBuffer[k++];

      while (k < j)
        _peek[_peekLength++] = _boundaryBuffer[k++];

      _peek[_peekLength++] = (byte) b;
      _peekOffset = 0;
    }

    if (i <= 0) {
      _isPartDone = true;
      if (b < 0)
        _isDone = true;
      return -1;
    }
    else {
      return i;
    }
  }
328586
@Override
    public int read(byte[] out, final int off, final int len) throws IOException {
        if (off < 0 || len < 0 || (off + len) > out.length) {
            throw new IllegalArgumentException(String.format(
                    "Illegal arguments for read: byte[%d], off:%d, len:%d",
                    out.length, off, len));
        }

        final int end = off + len;
        int pos = off;
        int i;
        while (pos < end && (i = in.read(out, off, end - off)) >= 0) {
            pos += i;
        }
        return pos - off;
    }
1033387
public void readBytes (Object to, long offset, int count) throws KryoException {
		int copyCount = Math.min(limit - position, count);
		while (true) {
			unsafe.copyMemory(null, bufferAddress + position, to, offset, copyCount);
			position += copyCount;
			count -= copyCount;
			if (count == 0) break;
			offset += copyCount;
			copyCount = Math.min(count, capacity);
			require(copyCount);
		}
		byteBuffer.position(position);
	}
41877
public int read(byte []buffer, int offset, int length)
    throws IOException
  {
    int len = _next.read(buffer, offset, length);

    _crc = Crc64.generate(_crc, buffer, offset, len);

    return len;
  }
630136
public int read (byte[] bytes, int offset, int count) throws KryoException {
		if (bytes == null) throw new IllegalArgumentException("bytes cannot be null.");
		int startingCount = count;
		int copyCount = Math.min(limit - position, count);
		while (true) {
			System.arraycopy(buffer, position, bytes, offset, copyCount);
			position += copyCount;
			count -= copyCount;
			if (count == 0) break;
			offset += copyCount;
			copyCount = optional(count);
			if (copyCount == -1) {
				// End of data.
				if (startingCount == count) return -1;
				break;
			}
			if (position == limit) break;
		}
		return startingCount - count;
	}
996791
def eth_getBlockHeaderByNumber(self, number):
        
        block_hash = self.reader._get_block_hash(number)
        block_number = _format_block_number(number)
        return self.reader._get_block_header(block_hash, block_number)
847314
public int read(byte []buf, int offset, int length) throws IOException
  {
    if (_stream != null)
      return _stream.read(buf, offset, length);
    else
      return -1;
  }
399413
public void writeDataBlock( int blockIndex , long blockOffset , byte[] blockData ) throws JournalException
    {
    	// Refuse any further operation in case of previous failure
    	if (failing)
    		throw new JournalException("Store journal is failing");
    	
        synchronized (journalWriteQueue)
        {
        	if (traceEnabled)
        		log.trace("["+baseName+"] #"+currentTransactionId+" Queueing data block write : ["+blockIndex+"] offset="+blockOffset+" size="+blockData.length+" / queueSize="+(journalWriteQueue.size()+1));
        	
        	DataBlockWriteOperation op = 
        		new DataBlockWriteOperation(currentTransactionId,
		        							blockIndex, 
		    		                        blockOffset, 
		    		                        blockData);
            journalWriteQueue.addLast(op);
            unflushedJournalSize += op.size();
            totalPendingOperations++;
        }
    }
1233612
public static Block fromElementBlock(int positionCount, Optional<boolean[]> valueIsNull, int[] arrayOffset, Block values)
    {
        validateConstructorArguments(0, positionCount, valueIsNull.orElse(null), arrayOffset, values);
        // for performance reasons per element checks are only performed on the public construction
        for (int i = 0; i < positionCount; i++) {
            int offset = arrayOffset[i];
            int length = arrayOffset[i + 1] - offset;
            if (length < 0) {
                throw new IllegalArgumentException(format("Offset is not monotonically ascending. offsets[%s]=%s, offsets[%s]=%s", i, arrayOffset[i], i + 1, arrayOffset[i + 1]));
            }
            if (valueIsNull.isPresent() && valueIsNull.get()[i] && length != 0) {
                throw new IllegalArgumentException("A null array must have zero entries");
            }
        }
        return new ArrayBlock(0, positionCount, valueIsNull.orElse(null), arrayOffset, values);
    }