Read.

@param version the version
@param time the time
@return the mtas solr collection cache item
186598
private MtasSolrCollectionCacheItem read(String version, Long time) {
    try {
      Path path = collectionCachePath.resolve(version);
      String data = new String(Files.readAllBytes(path),
          StandardCharsets.UTF_8);
      MtasSolrCollectionCacheItem decodedData = decode(data);

      // set correct time to reconstruct administration on restart
      if (time != null) {
        File file = path.toFile();
        if (!file.setLastModified(time)) {
          log.debug("couldn't change filetime " + file.getAbsolutePath());
        }
      }
      return decodedData;
    } catch (IOException e) {
      log.error("couldn't read " + version, e);
    }
    return null;
  }
1215746
public Version getDetailedVersion(String version) {
		prepareDetailedVersions();

		if (detailedVersions.containsKey(version)) {
			return detailedVersions.get(version);
		}
		
		return null;
	}
1065791
@FFDCIgnore(NumberFormatException.class)
    private void readWriteTimeAndJavaSpecVersion(WsResource res, String line) {
        int timeIndex = line.indexOf('=');
        int javaSpecVersionIndex = timeIndex >= 0 ? line.indexOf(';', timeIndex) : -1;
        if (timeIndex != -1) {
            try {
                String sTime = javaSpecVersionIndex > timeIndex ? line.substring(timeIndex + 1, javaSpecVersionIndex) : line.substring(timeIndex + 1);
                writeTime = Long.parseLong(sTime);
                if (javaSpecVersionIndex != -1) {
                    javaSpecVersion = Integer.valueOf(line.substring(javaSpecVersionIndex + 1));
                }
            } catch (NumberFormatException nfe) {
            }
        }

        if (writeTime <= 0) {
            writeTime = res.getLastModified();
        }
    }
587612
@GET
    @Produces({ MediaType.TEXT_PLAIN })
    public String getTime() {
        return String.valueOf(System.currentTimeMillis());
    }
1035954
@Override
    public DOReader getReader(boolean cachedObjectRequired, Context context,
            String pid) throws ServerException {
        long getReaderStartTime = logger.isDebugEnabled() ?
                System.currentTimeMillis() : -1;
        String source = null;
        try {
            {
                DOReader reader = null;
                if (m_readerCache != null) {
                    reader = m_readerCache.get(pid);
                }
                if (reader == null) {
                    reader =
                            new SimpleDOReader(context, this, m_translator,
                                    m_defaultExportFormat,
                                    m_defaultStorageFormat,
                                    m_storageCharacterEncoding,
                                    m_permanentStore.retrieveObject(pid));
                    source = "filesystem";
                    if (m_readerCache != null) {
                        m_readerCache.put(reader, getReaderStartTime);
                    }
                } else {
                    source = "memory";
                }
                return reader;
            }
        } finally {
            if (logger.isDebugEnabled()) {
                long dur = System.currentTimeMillis() - getReaderStartTime;
                logger.debug("Got DOReader (source={}) for {} in {}ms.",
                        source, pid, dur);
            }
        }
    }
1287080
@Override
    public Integer get_version(String path, boolean watch) throws Exception {
        return zkObj.getVersion(zk, path, watch);
    }
488445
@SuppressWarnings("unchecked")
    public synchronized ValT get(Object elementKey) {
        KeyT key = (KeyT) elementKey;
        ValT value = cache.get(key);
        if (value != null) {
            // memory hit
            Log.d(name, "MEM cache hit for " + key.toString());
            return value;
        }

        // memory miss, try reading from disk
        File file = getFileForKey(key);
        if (file.exists()) {
        	// if file older than expirationInMinutes, remove it
        	long lastModified = file.lastModified();
        	Date now = new Date();
        	long ageInMinutes = ((now.getTime() - lastModified) / (1000*60));
        	
        	if (ageInMinutes >= expirationInMinutes) {
        		Log.d(name, "DISK cache expiration for file " + file.toString());
        		file.delete();
        		return null;
        	}
        	
        	// disk hit
            Log.d(name, "DISK cache hit for " + key.toString());
            try {
                value = readValueFromDisk(file);
            } catch (IOException e) {
                // treat decoding errors as a cache miss
                e.printStackTrace();
                return null;
            }
            if (value == null) {
                return null;
            }
            cache.put(key, value);
            return value;
        }

        // cache miss
        return null;
    }
1192720
public static <K, N> InternalTimersSnapshotReader<K, N> getReaderForVersion(
		int version, ClassLoader userCodeClassLoader) {

		switch (version) {
			case NO_VERSION:
				return new InternalTimersSnapshotReaderPreVersioned<>(userCodeClassLoader);

			case 1:
				return new InternalTimersSnapshotReaderV1<>(userCodeClassLoader);

			case InternalTimerServiceSerializationProxy.VERSION:
				return new InternalTimersSnapshotReaderV2<>(userCodeClassLoader);

			default:
				// guard for future
				throw new IllegalStateException(
					"Unrecognized internal timers snapshot writer version: " + version);
		}
	}
558335
private Object readResolve() throws ObjectStreamException {
        // The old index field used to uniquely identify the time unit.
        switch (index) {
        case 6:
            return SECOND;
        case 5:
            return MINUTE;
        case 4:
            return HOUR;
        case 3:
            return DAY;
        case 2:
            return WEEK;
        case 1:
            return MONTH;
        case 0:
            return YEAR;
        default:
            throw new InvalidObjectException("Bad index: " + index);
        }
    }
756086
@SuppressWarnings("unchecked")
    public static <T> T get(Object key) {
        try {
            return (T) CACHE.get(key);
        } catch (ClassCastException e) {
            System.out.print("E/Cache: Can't use cached object: wrong type");
        }
        return null;
    }
1171778
private HashSet<String> get(String id) throws IOException {
    if (collectionCachePath != null) {
      Date date = clear();
      if (idToVersion.containsKey(id)) {
        String version = idToVersion.get(id);
        expirationVersion.put(version, date.getTime() + (1000 * lifeTime));
        MtasSolrCollectionCacheItem newItem = read(version, date.getTime());
        if (newItem != null && newItem.id.equals(id)) {
          return newItem.data;
        } else {
          log.error("couldn't get " + version);
          // delete file and remove from index
          if (!collectionCachePath.resolve(version).toFile().delete()) {
            log.debug("couldn't delete " + version);
          }
          idToVersion.remove(id);
          expirationVersion.remove(version);
          versionToItem.remove(version);
        }
      } else {
        log.error("doesn't exist anymore");
      }
      return null;
    } else

    {
      throw new IOException("no cachePath available, can't get data");
    }
  }
398072
JsonNode readCacheFile()
  {
    if (cacheFile == null || !this.checkCacheLockFile())
    {
      // no cache or the cache is not valid.
      return null;
    }
    try
    {
      if (!cacheFile.exists())
      {
        LOGGER.debug(
            "Cache file doesn't exists. File: {}", cacheFile);
        return null;
      }

      try (Reader reader = new InputStreamReader(
          new FileInputStream(cacheFile), DEFAULT_FILE_ENCODING))
      {
        return OBJECT_MAPPER.readTree(reader);
      }
    }
    catch (IOException ex)
    {
      LOGGER.debug(
          "Failed to read the cache file. No worry. File: {}, Err: {}",
          cacheFile, ex);
    }
    return null;
  }
127220
function (cache) {
                // Collect over the readset
                var that = this;
                this._mtx.rset.apply(function (key, value) {
                    var obj = cache.find(key);
                    shared.utils.dassert(obj != null);
                    that.collectObject(obj);
                    return true;
                });
            }
670009
private Object readResolve() {
        if (iChronology == null) {
            return new LocalDateTime(iLocalMillis, ISOChronology.getInstanceUTC());
        }
        if (DateTimeZone.UTC.equals(iChronology.getZone()) == false) {
            return new LocalDateTime(iLocalMillis, iChronology.withUTC());
        }
        return this;
    }
978081
public function read($api, $class, $version)
    {
        $cacheKey = md5($api . $class);

        if (isset($this->cache[$cacheKey]) && isset($this->cache[$cacheKey]['version'][$version])) {
            return $this->cache[$cacheKey]['version'][$version];
        }

        return false;
    }
721003
def mtime(self, key):
        """"""
        if key not in self.__dict:
            raise CacheKeyError(key)
        else:
            node = self.__dict[key]
            return node.mtime
326108
@Override
  public MarkTiming read(JsonReader in) throws IOException {
    if (in.peek() == JsonToken.NULL) {
      in.nextNull();
      return null;
    }

    final MarkTiming markTiming = new MarkTiming();
    in.beginArray();

    if (in.peek() == JsonToken.STRING) {
      markTiming.setMark(in.nextString());
    }
    if (in.peek() == JsonToken.NUMBER) {
      markTiming.setTime(in.nextDouble());
    }

    in.endArray();
    return markTiming;
  }