BufferNumberUtils

cc.otavia.buffer.utils.BufferNumberUtils

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

final def getFixedStringAsDouble(buffer: Buffer, index: Int, length: Int): Double

Parses a fixed-length string at the given index as a Double, without advancing the readerOffset. Uses zero-allocation manual mantissa/exponent parsing with three-tier conversion.

Parses a fixed-length string at the given index as a Double, without advancing the readerOffset. Uses zero-allocation manual mantissa/exponent parsing with three-tier conversion.

Attributes

final def getFixedStringAsLong(buffer: Buffer, index: Int, length: Int, radix: Int = ...): Long

Parses a fixed-length string at the given index as a signed Long, without advancing the readerOffset. Uses direct byte-level parsing with overflow checking (port of JDK Long.parseLong).

Parses a fixed-length string at the given index as a signed Long, without advancing the readerOffset. Uses direct byte-level parsing with overflow checking (port of JDK Long.parseLong).

Attributes

final def readFixedStringAsDouble(buffer: Buffer, length: Int): Double

Parses a fixed-length string in the buffer as a Double, then advances the readerOffset by length. Uses zero-allocation manual mantissa/exponent parsing with three-tier conversion.

Parses a fixed-length string in the buffer as a Double, then advances the readerOffset by length. Uses zero-allocation manual mantissa/exponent parsing with three-tier conversion.

Attributes

final def readFixedStringAsLong(buffer: Buffer, length: Int, radix: Int = ...): Long

Parses a fixed-length string in the buffer as a signed Long, then advances the readerOffset by length. Uses direct byte-level parsing with overflow checking (port of JDK Long.parseLong).

Parses a fixed-length string in the buffer as a signed Long, then advances the readerOffset by length. Uses direct byte-level parsing with overflow checking (port of JDK Long.parseLong).

Attributes

final def readStringAsBigDecimal(buffer: Buffer): BigDecimal

Parse a variable-length string at the current readerOffset as a Scala BigDecimal. Supports decimal point and scientific notation. Advances the readerOffset past the parsed characters.

Parse a variable-length string at the current readerOffset as a Scala BigDecimal. Supports decimal point and scientific notation. Advances the readerOffset past the parsed characters.

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed BigDecimal value.

final def readStringAsBigInt(buffer: Buffer): BigInt

Parse a variable-length decimal string at the current readerOffset as a Scala BigInt. Advances the readerOffset past the parsed digits (and optional leading '-').

Parse a variable-length decimal string at the current readerOffset as a Scala BigInt. Advances the readerOffset past the parsed digits (and optional leading '-').

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed BigInt value.

Throws
NumberFormatException

if the string contains no digits.

final def readStringAsBigInteger(buffer: Buffer): BigInteger

Parse a variable-length decimal string at the current readerOffset as a BigInteger. Advances the readerOffset past the parsed digits (and optional leading '-').

Parse a variable-length decimal string at the current readerOffset as a BigInteger. Advances the readerOffset past the parsed digits (and optional leading '-').

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed BigInteger value.

Throws
NumberFormatException

if the string contains no digits.

final def readStringAsDouble(buffer: Buffer): Double

Parse a variable-length string at the current readerOffset as a Double. Supports optional sign, decimal point, and scientific notation (e/E). Uses zero-allocation mantissa/exponent parsing with three-tier conversion for performance. Advances the readerOffset past the parsed characters.

Parse a variable-length string at the current readerOffset as a Double. Supports optional sign, decimal point, and scientific notation (e/E). Uses zero-allocation mantissa/exponent parsing with three-tier conversion for performance. Advances the readerOffset past the parsed characters.

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed double value.

Throws
NumberFormatException

if the string does not represent a valid double value.

final def readStringAsFloat(buffer: Buffer): Float

Parse a variable-length string at the current readerOffset as a Float. Supports optional sign, decimal point, and scientific notation (e/E). Uses zero-allocation mantissa/exponent parsing with three-tier conversion for performance. Advances the readerOffset past the parsed characters.

Parse a variable-length string at the current readerOffset as a Float. Supports optional sign, decimal point, and scientific notation (e/E). Uses zero-allocation mantissa/exponent parsing with three-tier conversion for performance. Advances the readerOffset past the parsed characters.

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed float value.

Throws
NumberFormatException

if the string does not represent a valid float value.

final def readStringAsInt(buffer: Buffer): Int

Parse a variable-length decimal string at the current readerOffset as an Int. Advances the readerOffset past the parsed digits (and optional leading '-').

Parse a variable-length decimal string at the current readerOffset as an Int. Advances the readerOffset past the parsed digits (and optional leading '-').

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed int value.

Throws
NumberFormatException

if the string does not represent a valid int value.

final def readStringAsJBigDecimal(buffer: Buffer): BigDecimal

Parse a variable-length string at the current readerOffset as a java.math.BigDecimal. Supports decimal point and scientific notation. Advances the readerOffset past the parsed characters.

Parse a variable-length string at the current readerOffset as a java.math.BigDecimal. Supports decimal point and scientific notation. Advances the readerOffset past the parsed characters.

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed BigDecimal value.

final def readStringAsLong(buffer: Buffer): Long

Parse a variable-length decimal string at the current readerOffset as a Long. Supports optional leading '+' or '-'. Advances the readerOffset past the parsed digits.

Parse a variable-length decimal string at the current readerOffset as a Long. Supports optional leading '+' or '-'. Advances the readerOffset past the parsed digits.

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed long value.

Throws
NumberFormatException

if the string does not represent a valid long value or overflows.

final def readStringAsShort(buffer: Buffer): Short

Parse a variable-length decimal string at the current readerOffset as a Short. Advances the readerOffset past the parsed digits (and optional leading '-').

Parse a variable-length decimal string at the current readerOffset as a Short. Advances the readerOffset past the parsed digits (and optional leading '-').

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed short value.

Throws
NumberFormatException

if the string does not represent a valid short value.

final def writeBigDecimalAsString(buffer: Buffer, bigDecimal: BigDecimal): Unit

Write the given Scala BigDecimal as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Write the given Scala BigDecimal as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Value parameters

bigDecimal

The BigDecimal value to write.

buffer

The buffer to write to.

Attributes

final def writeBigIntAsString(buffer: Buffer, bigInt: BigInt): Unit

Write the given BigInt as a decimal ASCII string at the current writerOffset. Delegates to writeLongAsString if the value fits in a long, otherwise uses BigInteger rendering. Advances the writerOffset by the number of bytes written.

Write the given BigInt as a decimal ASCII string at the current writerOffset. Delegates to writeLongAsString if the value fits in a long, otherwise uses BigInteger rendering. Advances the writerOffset by the number of bytes written.

Value parameters

bigInt

The BigInt value to write.

buffer

The buffer to write to.

Attributes

final def writeBigIntegerAsString(buffer: Buffer, num: BigInteger): Unit

Write the given BigInteger as a decimal ASCII string at the current writerOffset. Delegates to writeLongAsString if the value fits in a long, otherwise uses recursive division. Advances the writerOffset by the number of bytes written.

Write the given BigInteger as a decimal ASCII string at the current writerOffset. Delegates to writeLongAsString if the value fits in a long, otherwise uses recursive division. Advances the writerOffset by the number of bytes written.

Value parameters

buffer

The buffer to write to.

num

The BigInteger value to write.

Attributes

final def writeDoubleAsString(buffer: Buffer, double: Double): Unit

Write the given Double as a decimal ASCII string at the current writerOffset. Uses the Schubfach algorithm for exact double-to-decimal conversion. Advances the writerOffset by the number of bytes written.

Write the given Double as a decimal ASCII string at the current writerOffset. Uses the Schubfach algorithm for exact double-to-decimal conversion. Advances the writerOffset by the number of bytes written.

Value parameters

buffer

The buffer to write to.

double

The double value to write.

Attributes

final def writeFloatAsString(buffer: Buffer, float: Float): Unit

Write the given Float as a decimal ASCII string at the current writerOffset. Uses the Schubfach algorithm for exact float-to-decimal conversion. Advances the writerOffset by the number of bytes written.

Write the given Float as a decimal ASCII string at the current writerOffset. Uses the Schubfach algorithm for exact float-to-decimal conversion. Advances the writerOffset by the number of bytes written.

Value parameters

buffer

The buffer to write to.

float

The float value to write.

Attributes

final def writeIntAsString(buffer: Buffer, int: Int): Unit

Write the given Int as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Write the given Int as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Value parameters

buffer

The buffer to write to.

int

The int value to write.

Attributes

final def writeJBigDecimalAsString(buffer: Buffer, bigDecimal: BigDecimal): Unit

Write the given java.math.BigDecimal as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Write the given java.math.BigDecimal as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Value parameters

bigDecimal

The BigDecimal value to write.

buffer

The buffer to write to.

Attributes

final def writeLongAsString(buffer: Buffer, long: Long): Unit

Write the given Long as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Write the given Long as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Value parameters

buffer

The buffer to write to.

long

The long value to write.

Attributes

final def writeShortAsString(buffer: Buffer, short: Short): Unit

Write the given Short as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Write the given Short as a decimal ASCII string at the current writerOffset. Advances the writerOffset by the number of bytes written.

Value parameters

buffer

The buffer to write to.

short

The short value to write.

Attributes

final protected def writeSignificantFractionDigits(x: Int, p: Int, posLim: Int, buffer: Buffer, ds: Array[Short]): Unit

Inherited methods

final protected def byteToChar(b2: Byte): Char

Attributes

Inherited from:
BufferBaseUtils
final protected def digitCount(q0: Long): Int

Attributes

Inherited from:
BufferBaseUtils
final def getStringAsBoolean(buffer: Buffer, index: Int): Boolean

Get a "true" or "false" string at the given index as a Boolean, without advancing the readerOffset.

Get a "true" or "false" string at the given index as a Boolean, without advancing the readerOffset.

Value parameters

buffer

The buffer to read from.

index

The absolute offset into the buffer.

Attributes

Returns

The parsed boolean value.

Inherited from:
BufferBaseUtils
final def isNonEscapedAscii(ch: Char): Boolean

Checks if a character does not require JSON escaping or encoding.

Checks if a character does not require JSON escaping or encoding.

Value parameters

ch

the character to check

Attributes

Returns

true if the character is a basic ASCII character (code point less than 0x80) that does not need JSON escaping

Inherited from:
BufferBaseUtils
final def readStringAsBoolean(buffer: Buffer): Boolean

Parse a "true" or "false" string at the current readerOffset as a Boolean. Advances the readerOffset past the parsed characters.

Parse a "true" or "false" string at the current readerOffset as a Boolean. Advances the readerOffset past the parsed characters.

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed boolean value.

Inherited from:
BufferBaseUtils
final def readStringAsByte(buffer: Buffer): Byte

Parse a variable-length decimal string at the current readerOffset as a Byte. Advances the readerOffset past the parsed digits (and optional leading '-').

Parse a variable-length decimal string at the current readerOffset as a Byte. Advances the readerOffset past the parsed digits (and optional leading '-').

Value parameters

buffer

The buffer to read from.

Attributes

Returns

The parsed byte value.

Throws
NumberFormatException

if the string does not represent a valid byte value.

Inherited from:
BufferBaseUtils
final protected def rop(g: Long, cp: Int): Int

Attributes

Inherited from:
BufferBaseUtils
final protected def rop(g1: Long, g0: Long, cp: Long): Long

Attributes

Inherited from:
BufferBaseUtils
final def setBooleanAsString(buffer: Buffer, index: Int, boolean: Boolean): Unit

Set "true" or "false" at the given index, without modifying the writerOffset.

Set "true" or "false" at the given index, without modifying the writerOffset.

Value parameters

boolean

The boolean value to write.

buffer

The buffer to write to.

index

The absolute offset into the buffer.

Attributes

Inherited from:
BufferBaseUtils
final protected def write18Digits(buffer: Buffer, x: Long, ds: Array[Short]): Unit

Attributes

Inherited from:
BufferBaseUtils
final protected def write2Digits(buffer: Buffer, q0: Int, ds: Array[Short]): Unit

Attributes

Inherited from:
BufferBaseUtils
final protected def write3Digits(buffer: Buffer, q0: Int, ds: Array[Short]): Unit

Attributes

Inherited from:
BufferBaseUtils
final protected def write4Digits(buffer: Buffer, q0: Int, ds: Array[Short]): Unit

Attributes

Inherited from:
BufferBaseUtils
final protected def write8Digits(buffer: Buffer, q0: Long, ds: Array[Short]): Unit

Attributes

Inherited from:
BufferBaseUtils
final def writeBooleanAsString(buffer: Buffer, boolean: Boolean): Unit

Write "true" or "false" at the current writerOffset.

Write "true" or "false" at the current writerOffset.

Value parameters

boolean

The boolean value to write.

buffer

The buffer to write to.

Attributes

Inherited from:
BufferBaseUtils
final def writeByteAsString(buffer: Buffer, byte: Byte): Unit

Write the given Byte as a decimal ASCII string at the current writerOffset.

Write the given Byte as a decimal ASCII string at the current writerOffset.

Value parameters

buffer

The buffer to write to.

byte

The byte value to write.

Attributes

Inherited from:
BufferBaseUtils
final protected def writePositiveIntDigits(q: Int, p: Int, buffer: Buffer, ds: Array[Short]): Unit

Attributes

Inherited from:
BufferBaseUtils