shark-hprof / shark / StreamingHprofReader
class StreamingHprofReader
Reads the entire content of a Hprof source in one fell swoop. Call readerFor to obtain a new instance.
Name | Summary |
---|---|
readRecords | fun readRecords(recordTags: Set < HprofRecordTag >, listener: OnHprofRecordTagListener ): Long Obtains a new source to read all hprof records from and calls [listener](read-records.md#shark.StreamingHprofReader$readRecords(kotlin.collections.Set((shark.HprofRecordTag)), shark.OnHprofRecordTagListener)/listener) back for each record that matches one of the provided [recordTags](read-records.md#shark.StreamingHprofReader$readRecords(kotlin.collections.Set((shark.HprofRecordTag)), shark.OnHprofRecordTagListener)/recordTags). |
Name | Summary |
---|---|
readerFor | fun readerFor(hprofFile: File , hprofHeader: HprofHeader = HprofHeader.parseHeaderOf(hprofFile)): StreamingHprofReader Creates a StreamingHprofReader for the provided [hprofFile](reader-for.md#shark.StreamingHprofReader.Companion$readerFor(java.io.File, shark.HprofHeader)/hprofFile). [hprofHeader](reader-for.md#shark.StreamingHprofReader.Companion$readerFor(java.io.File, shark.HprofHeader)/hprofHeader) will be read from [hprofFile](reader-for.md#shark.StreamingHprofReader.Companion$readerFor(java.io.File, shark.HprofHeader)/hprofFile) unless you provide it. fun readerFor(hprofSourceProvider: StreamingSourceProvider , hprofHeader: HprofHeader ` = hprofSourceProvider.openStreamingSource() |
.use { HprofHeader.parseHeaderOf(it) }): [ StreamingHprofReader`](./index.md)Creates a StreamingHprofReader that will call StreamingSourceProvider.openStreamingSource on every readRecords to obtain a Source to read the hprof data from. Before reading the hprof records, StreamingHprofReader will skip HprofHeader.recordsPosition bytes. |