Package ghidra.formats.gfilesystem

# Class FileCache.FileCacheEntry

java.lang.Object
ghidra.formats.gfilesystem.FileCache.FileCacheEntry

Enclosing class:
  FileCache

public static class FileCache.FileCacheEntry extends Object
Represents a cached file. It may be an actual file if `file` is set, or if smaller than `2Mb'ish` just an in-memory byte array that is weakly pinned in the `FileCache.memCache` map.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ByteProvider`
  `asByteProvider(FSRL fsrl)`
  Returns the contents of this cache entry as a `ByteProvider`, using the specified `FSRL`.
  `boolean`
  `equals(Object obj)`
  `String`
  `getMD5()`
  Returns the MD5 of this cache entry.
  `int`
  `hashCode()`
  `long`
  `length()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### asByteProvider

    public ByteProvider asByteProvider(FSRL fsrl) throws IOException
    Returns the contents of this cache entry as a `ByteProvider`, using the specified `FSRL`.

    Parameters:
      `fsrl` - `FSRL` that the returned `ByteProvider` should have as its identity
    Returns:
      new `ByteProvider` containing the contents of this cache entry, caller is responsible for `closing`
    Throws:
      `IOException` - if error

  - ### getMD5

    public String getMD5()
    Returns the MD5 of this cache entry.
    Returns:
      the MD5 (as a string) of this cache entry

  - ### length

    public long length()

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`