Skip to content
🤔 Documentation issue? Report it

//leakcanary-repo/shark/StreamingHprofReader/Companion/readerFor

readerFor

[jvm]\ fun readerFor(hprofFile: File, hprofHeader: HprofHeader = HprofHeader.parseHeaderOf(hprofFile)): StreamingHprofReader

Creates a StreamingHprofReader for the provided hprofFile. hprofHeader will be read from hprofFile unless you provide it.

[jvm]\ fun readerFor(hprofSourceProvider: StreamingSourceProvider, hprofHeader: HprofHeader = hprofSourceProvider.openStreamingSource() .use { HprofHeader.parseHeaderOf(it) }): StreamingHprofReader

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.