Buffer
A collection of bytes in memory.
Moving data from one buffer to another is fast. Instead of copying bytes from one place in memory to another, this class just changes ownership of the underlying byte arrays.
This buffer grows with your data. Just like ArrayList, each buffer starts small. It consumes only the memory it needs to.
This buffer pools its byte arrays. When you allocate a byte array in Java, the runtime must zero-fill the requested array before returning it to you. Even if you're going to write over that space anyway. This class avoids zero-fill and GC churn by pooling byte arrays.
Constructors
Types
UnsafeCursor
Link copied to clipboard
Functions
completeSegmentByteCount
Link copied to clipboard
copyTo
Link copied to clipboard
Overload of copyTo with byteCount = size - offset, work around for https://youtrack.jetbrains.
@JvmOverloads()
Content copied to clipboard
emitCompleteSegments
Link copied to clipboard
hmacSha1
Link copied to clipboard
hmacSha256
Link copied to clipboard
hmacSha512
Link copied to clipboard
indexOf
Link copied to clipboard
indexOfElement
Link copied to clipboard
open override fun indexOfElement(targetBytes: ByteString, fromIndex: Long): Long
Content copied to clipboard
abstract fun indexOfElement(targetBytes: ByteString, fromIndex: Long): Long
Content copied to clipboard
inputStream
Link copied to clipboard
md5
Link copied to clipboard
outputStream
Link copied to clipboard
rangeEquals
Link copied to clipboard
open override fun rangeEquals(offset: Long, bytes: ByteString, bytesOffset: Int, byteCount: Int): Boolean
Content copied to clipboard
abstract fun rangeEquals(offset: Long, bytes: ByteString, bytesOffset: Int, byteCount: Int): Boolean
Content copied to clipboard
readAndWriteUnsafe
Link copied to clipboard
fun readAndWriteUnsafe(unsafeCursor: Buffer.UnsafeCursor = UnsafeCursor()): Buffer.UnsafeCursor
Content copied to clipboard
@JvmOverloads()
Content copied to clipboard
readFrom
Link copied to clipboard
readString
Link copied to clipboard
readUnsafe
Link copied to clipboard
fun readUnsafe(unsafeCursor: Buffer.UnsafeCursor = UnsafeCursor()): Buffer.UnsafeCursor
Content copied to clipboard
@JvmOverloads()
Content copied to clipboard
readUtf8LineStrict
Link copied to clipboard
sha1
Link copied to clipboard
sha256
Link copied to clipboard
sha512
Link copied to clipboard
snapshot
Link copied to clipboard
write
Link copied to clipboard
open override fun write(byteString: ByteString, offset: Int, byteCount: Int): Buffer
Content copied to clipboard
open override fun write(byteString: ByteString, offset: Int, byteCount: Int): Buffer
Content copied to clipboard
writeDecimalLong
Link copied to clipboard
writeHexadecimalUnsignedLong
Link copied to clipboard
writeIntLe
Link copied to clipboard
writeLongLe
Link copied to clipboard
writeShort
Link copied to clipboard
writeShortLe
Link copied to clipboard
writeString
Link copied to clipboard
writeTo
Link copied to clipboard
@JvmOverloads()
Content copied to clipboard
writeUtf8
Link copied to clipboard
writeUtf8CodePoint
Link copied to clipboard