DiskStore

A Store implementation compatible with the native main_file_cache.dat2 (or main_file_cache.dat) and main_file_cache.idx* format used by the client.

It supports opening existing caches with a main_file_cache.dat2m file for compatibility purposes. It does not support creating new caches with a .dat2m file, as FlatFileStore is a much better choice for storing large caches.

This class is not thread safe.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun create(archive: Int)

Creates an archive. Does nothing if the archive already exists.

Link copied to clipboard
open override fun exists(archive: Int): Boolean

Checks whether an archive exists.

open override fun exists(archive: Int, group: Int): Boolean

Checks whether a group exists.

Link copied to clipboard
open override fun flush()
Link copied to clipboard
open override fun list(): List<Int>

Lists all archives in the store.

open override fun list(archive: Int): List<Int>

Lists all groups in an archive.

Link copied to clipboard
open override fun read(archive: Int, group: Int): ByteBuf

Reads a group.

Link copied to clipboard
open override fun remove(archive: Int)

Deletes an archive and all groups contained inside it. Does nothing if the archive does not exist.

open override fun remove(archive: Int, group: Int)

Deletes a group. Does nothing if the archive or group does not exist.

Link copied to clipboard
open override fun write(archive: Int, group: Int, buf: ByteBuf)

Writes a group. If the archive does not exist, it is created first. If a group with the same ID already exists, it is overwritten.