Be able to re-read data that is stored that has already been re-read.  This is not a standard Stream behavior, but can be useful
in a standalone mode.
492810
public void reset() {
		for(ByteBuffer bb : bbs) {
			bb.position(0);
		}
		if(bbs.isEmpty()) {
			curr = null;
			idx = 0;
		} else {
			curr=bbs.get(0);
			idx=1;
		}
	}
1018168
@Override
	public RecoverableWriter.ResumeRecoverable persist() throws IOException {
		lock();
		try {
			fileStream.flush();
			openNewPartIfNecessary(userDefinedMinPartSize);

			// We do not stop writing to the current file, we merely limit the upload to the
			// first n bytes of the current file

			return upload.snapshotAndGetRecoverable(fileStream);
		}
		finally {
			unlock();
		}
	}
1015733
private void readShortRepeatValues(int firstByte)
            throws IOException
    {
        // read the number of bytes occupied by the value
        int size = (firstByte >>> 3) & 0b0111;
        // #bytes are one off
        size += 1;

        // read the run length
        int length = firstByte & 0x07;
        // run lengths values are stored only after MIN_REPEAT value is met
        length += MIN_REPEAT_SIZE;

        // read the repeated value which is store using fixed bytes
        long val = bytesToLongBE(input, size);

        if (signed) {
            val = LongDecode.zigzagDecode(val);
        }

        // repeat the value for length times
        for (int i = 0; i < length; i++) {
            literals[numLiterals++] = val;
        }
    }
766037
@Override
  public void reset () throws IOException
  {
    _ensureOpen ();
    if (m_nMarkedChar < 0)
      throw new IOException (m_nMarkedChar == INVALIDATED ? "Mark invalid" : "Stream not marked");
    m_nNextCharIndex = m_nMarkedChar;
    m_bSkipLF = m_bMarkedSkipLF;
  }
476152
@Override
  public D readRecordImpl(@Deprecated D reuse) throws DataRecordException, IOException {
    this.totalRecordCount++;

    if (this.statusCount > 0 && this.totalRecordCount % this.statusCount == 0) {
      LOG.info("Total number of records processed so far: " + this.totalRecordCount);
    }

    // If records have been read, check the hasNext value, if not then get the next file to process
    if (this.currentFile != null && this.currentFileItr != null) {
      this.hasNext = this.currentFileItr.hasNext();

      // If the current file is done, move to the next one
      if (!this.hasNext) {
        getNextFileToRead();
      }
    } else {
      // If no records have been read yet, get the first file to process
      getNextFileToRead();
    }

    if (this.hasNext) {
      return this.currentFileItr.next();
    }

    LOG.info("Finished reading records from all files");
    return null;
  }
458429
private int readNext(byte[] dest, int offset, int len)
            throws IOException
    {
        int readBytes = 0;
        while (readBytes < len) {
            int ret = in.read(dest, readBytes + offset, len - readBytes);
            if (ret == -1) {
                finishedReading = true;
                return readBytes;
            }
            readBytes += ret;
        }
        return readBytes;
    }
502096
@Override
    public void reinitValue(DataReader in, EntryValueShort value) throws IOException {
        value.reinit(in.readInt(),   /* array position */
                     in.readShort(), /* data value */
                     in.readLong()   /* SCN value */);
    }
180778
def refresh
      # This iteration might look scary as we iterate over the entries while
      # while we are rearranging them. Re-inserted items may be inserted
      # before or at the current entry and this is fine. They also may be
      # inserted after the current entry and will be re-read again unless they
      # are inserted after the original file end.
      file_size = @f.size

      # We don't update the index and the space list during this operation as
      # we defragmentize the blob file at the end. We'll end the operation
      # with an empty space list.
      clear_index_files

      @progressmeter.start('Converting objects to new storage format',
                           @f.size) do |pm|
        each_blob_header do |header|
          if header.is_valid?
            buf = read_obj_by_address(header.addr, header.id)
            delete_obj_by_address(header.addr, header.id)
            write_obj_by_id(header.id, buf)
          end

          # Some re-inserted blobs may be inserted after the original file end.
          # No need to process those blobs again.
          break if header.addr >= file_size

          pm.update(header.addr)
        end
      end

      # Reclaim the space saved by compressing entries.
      defragmentize

      # Recreate the index file and create an empty space list.
      regenerate_index_and_spaces
    end
58123
def unread_data(self, data: bytes) -> None:
        
        warnings.warn("unread_data() is deprecated "
                      "and will be removed in future releases (#3260)",
                      DeprecationWarning,
                      stacklevel=2)
        if not data:
            return

        if self._buffer_offset:
            self._buffer[0] = self._buffer[0][self._buffer_offset:]
            self._buffer_offset = 0
        self._size += len(data)
        self._cursor -= len(data)
        self._buffer.appendleft(data)
        self._eof_counter = 0
1290705
private static Object readDynamic(StreamingInput input)
		throws IOException
	{
		switch(input.peek())
		{
			case VALUE:
				input.next();
				return input.getValue();
			case NULL:
				input.next();
				return input.getValue();
			case LIST_START:
				return readList(input);
			case OBJECT_START:
				return readMap(input);
		}

		throw new SerializationException("Unable to read file, unknown start of value: " + input.peek());
	}
291086
private void rebuildIndex() throws Exception {
      ByteBuffer buf = ByteBuffer.allocate(KEY_POS);
      for (; ; ) {
         // read FileEntry fields from file (size, keyLen etc.)
         buf.clear().limit(KEY_POS);
         channel.read(buf, filePos);
         // return if end of file is reached
         if (buf.remaining() > 0)
            return;
         buf.flip();

         // initialize FileEntry from buffer
         int entrySize = buf.getInt();
         int keyLen = buf.getInt();
         int dataLen = buf.getInt();
         int metadataLen = buf.getInt();
         long expiryTime = buf.getLong();
         FileEntry fe = new FileEntry(filePos, entrySize, keyLen, dataLen, metadataLen, expiryTime);

         // sanity check
         if (fe.size < KEY_POS + fe.keyLen + fe.dataLen + fe.metadataLen) {
            throw log.errorReadingFileStore(file.getPath(), filePos);
         }

         // update file pointer
         filePos += fe.size;

         // check if the entry is used or free
         if (fe.keyLen > 0) {
            // load the key from file
            if (buf.capacity() < fe.keyLen)
               buf = ByteBuffer.allocate(fe.keyLen);

            buf.clear().limit(fe.keyLen);
            channel.read(buf, fe.offset + KEY_POS);

            // deserialize key and add to entries map
            // Marshaller should allow for provided type return for safety
            K key = (K) ctx.getMarshaller().objectFromByteBuffer(buf.array(), 0, fe.keyLen);
            entries.put(key, fe);
         } else {
            // add to free list
            freeList.add(fe);
         }
      }
   }
801040
@SuppressWarnings("unchecked")
  private void readNext() {
    // Compute the index of the next entry in the segment.
    final long index = getNextIndex();

    // Mark the buffer so it can be reset if necessary.
    buffer.mark();

    try {
      // Read the length of the entry.
      final int length = buffer.getInt();

      // If the buffer length is zero then return.
      if (length <= 0 || length > maxEntrySize) {
        buffer.reset();
        nextEntry = null;
        return;
      }

      // Read the checksum of the entry.
      long checksum = buffer.getInt() & 0xFFFFFFFFL;

      // Compute the checksum for the entry bytes.
      final CRC32 crc32 = new CRC32();
      ByteBuffer slice = buffer.slice();
      slice.limit(length);
      crc32.update(slice);

      // If the stored checksum equals the computed checksum, return the entry.
      if (checksum == crc32.getValue()) {
        slice.rewind();
        E entry = namespace.deserialize(slice);
        nextEntry = new Indexed<>(index, entry, length);
        buffer.position(buffer.position() + length);
      } else {
        buffer.reset();
        nextEntry = null;
      }
    } catch (BufferUnderflowException e) {
      buffer.reset();
      nextEntry = null;
    }
  }
1114919
private void readObject(ObjectInputStream stream)
        throws IOException, ClassNotFoundException
    {
        stream.defaultReadObject();

        // set transient fields
        setOut( System.out );
        setErr( System.err );
    }
1140566
private boolean doRead(int amountToRead) throws IOException{
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
            Tr.debug(tc, "doRead, Current buffer, " + _buffer + ", reading from the TCP Channel, readLine : " + _isReadLine);
        }
        
        try {
            
            if(_tcpChannelCallback != null && !_isReadLine){
                //async read logic
                return immediateRead(amountToRead);
            } else {
                return syncRead(amountToRead);
            }
        } catch (IOException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
                Tr.debug(tc, "doRead, we encountered an exception during the read : " + e);
            }
            
            if(_error != null){
                return false;
            }
            _error = e;
            throw e;
        }
    }
324932
private function read()
    {
        $this->lock();

        $data = '';

        rewind($this->handle);

        $data = trim(stream_get_contents($this->handle));

        if ($data !== '') {
            $this->data = unserialize($data);
            $data = null;
        }

        flock($this->handle, LOCK_UN);

        $this->iterator = new \ArrayIterator($this->data);
    }
826331
def _rewind(self):
        ''''''
        DFReader._rewind(self)
        self.line = 0
        # find the first valid line
        while self.line < len(self.lines):
            if self.lines[self.line].startswith("FMT, "):
                break
            self.line += 1
840739
def reopen(self):
      """"""
      # Read any remaining content in the file and store it in a buffer.
      self._read()
      # Close it to ensure we don't leak file descriptors
      self._close()
      
      # Reopen the file.
      try:
         self._open(self._path, skip_to_end = False)
         return True
      except OSError:
         # If opening fails, it was probably deleted.
         return False