InputStream backed by a ByteBuffer (typically a MappedByteBuffer from PakManager.mapWhole). Reads advance the buffer's position; mark/reset is supported via the buffer's mark()/reset().
InputStream interface — every Kotlin asset reader that already calls openInputStream (GLXFFileLoader, LocalizedAssetResolver, etc.) gets the win without changes.
FileChannel's internal cleaner on the MappedByteBuffer) survives until this stream is GC'd.
class MappedByteBufferInputStream(buffer: ByteBuffer) : InputStream
MappedByteBufferInputStream
(
buffer
)
|
Signature
constructor(buffer: ByteBuffer) Parameters buffer: ByteBufferReturns MappedByteBufferInputStream |
available
()
|
Signature
open override fun available(): Int Returns Int |
close
()
|
Signature
open override fun close() |
mark
(
readlimit
)
|
Signature
open override fun mark(readlimit: Int) Parameters readlimit: Int |
markSupported
()
|
Signature
open override fun markSupported(): Boolean Returns Boolean |
read
()
|
Signature
open override fun read(): Int Returns Int |
read
(
b
, off
, len
)
|
Signature
open override fun read(b: ByteArray, off: Int, len: Int): Int Parameters b: ByteArrayoff: Intlen: IntReturns Int |
read
(
p0
)
|
Signature
open fun read(p0: ByteArray): Int Parameters p0: ByteArrayReturns Int |
readAllBytes
()
|
Signature
open fun readAllBytes(): ByteArray Returns ByteArray |
readNBytes
(
p0
)
|
Signature
open fun readNBytes(p0: Int): ByteArray Parameters p0: IntReturns ByteArray |
readNBytes
(
p0
, p1
, p2
)
|
Signature
open fun readNBytes(p0: ByteArray, p1: Int, p2: Int): Int Parameters p0: ByteArrayp1: Intp2: IntReturns Int |
reset
()
|
Signature
open override fun reset() |
skip
(
n
)
|
Signature
open override fun skip(n: Long): Long Parameters n: LongReturns Long |
transferTo
(
p0
)
|
Signature
open fun transferTo(p0: OutputStream): Long Parameters p0: OutputStreamReturns Long |