TastyBuffer

class TastyBuffer(initialSize: Int)

A byte array buffer that can be filled with bytes or natural numbers in TASTY format, and that supports reading and patching addresses represented as natural numbers.

Companion:
object
class Object
trait Matchable
class Any

Value members

Concrete methods

The address referring to the end of data written so far

The address referring to the end of data written so far

def getByte(at: Addr): Int

The byte at given address

The byte at given address

def getLongNat(at: Addr): Long

The long natural number at address at

The long natural number at address at

def getNat(at: Addr): Int

The natural number at address at

The natural number at address at

def writeByte(b: Int): Unit

Write a byte of data.

Write a byte of data.

def writeBytes(data: Array[Byte], n: Int): Unit

Write the first n bytes of data.

Write the first n bytes of data.

def writeLongNat(x: Long): Unit

Like writeNat, but for longs. Note that the binary representation of LongNat is identical to Nat if the long value is in the range Int.MIN_VALUE to Int.MAX_VALUE.

Like writeNat, but for longs. Note that the binary representation of LongNat is identical to Nat if the long value is in the range Int.MIN_VALUE to Int.MAX_VALUE.

def writeNat(x: Int): Unit

Write a natural number in big endian format, base 128. All but the last digits have bit 0x80 set.

Write a natural number in big endian format, base 128. All but the last digits have bit 0x80 set.

Concrete fields

var bytes: Array[Byte]

The current byte array, will be expanded as needed

The current byte array, will be expanded as needed

var length: Int

The number of bytes written

The number of bytes written