Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
A
- API_VERSION - Static variable in class org.sofabuffers.sofab.Sofab
-
SofaBuffers core API version.
- argument(String) - Static method in class org.sofabuffers.sofab.Sofab
-
The carrier a defect in the call is refused through: a
SofabError.ARGUMENTSofabException, wrapped likeSofab.invalid(String)so it can leave a callback that declares no checked exception. - ARGUMENT - Enum constant in enum class org.sofabuffers.sofab.SofabError
-
Invalid caller argument (e.g. a field id outside
0..ID_MAX). - ARRAY_INIT_CAP - Static variable in class org.sofabuffers.sofab.Seq
-
Initial element capacity for an array whose length is not bounded by the schema.
- ARRAY_MAX - Static variable in class org.sofabuffers.sofab.Sofab
-
Largest array element count / fixed-length byte count,
2^31 - 1(INT32_MAX). - arrayBegin(int, ArrayKind, int) - Method in interface org.sofabuffers.sofab.Visitor
-
Start of an array field.
- arrayBulk(int, ArrayKind, int) - Method in interface org.sofabuffers.sofab.Visitor
-
Offer to take an integer array's elements in bulk instead of one call at a time.
- arrayBulkEnd(int, int) - Method in interface org.sofabuffers.sofab.Visitor
-
The bulk fill offered at
Visitor.arrayBulk(int, ArrayKind, int)is complete:nelements were written into the destination. - ArrayKind - Enum Class in org.sofabuffers.sofab
-
Element category of an array field, reported to a
VisitorviaVisitor.arrayBegin(int, ArrayKind, int)just before the elements are delivered.
B
- blob(int, int, byte[], int, int, Bound) - Method in class org.sofabuffers.sofab.PayloadAcc
-
Offer a chunk of a
blobpayload; returns the payload once the last chunk has arrived,nullwhile more are expected. - blob(int, int, int, byte[], int, int) - Method in interface org.sofabuffers.sofab.Visitor
-
A chunk of a blob field.
- BLOB - Enum constant in enum class org.sofabuffers.sofab.FixlenType
-
Arbitrary raw bytes.
- boolsToLongs(List) - Static method in class org.sofabuffers.sofab.Seq
-
Convert a boolean wrapper array to the
long[]the encoder writes. - Bound - Record Class in org.sofabuffers.sofab
-
Which of the two rules of CORELIB_PLAN §6.2.1 bounds this field: the schema's
count/maxlen, or a receiver cap the deployment configured — and, with it, the number and the verdict a breach earns. - Bound(long, Bound.Rule) - Constructor for record class org.sofabuffers.sofab.Bound
-
Validates a bound however it is made: the rule must be stated, a stated number is at least
1, and onlyBound.Rule.CALLER_CHECKEDcarries none (-1). - Bound.Rule - Enum Class in org.sofabuffers.sofab
-
Which of §6.2.1's answers a
Boundstates, and so its verdict. - BUFFER_FULL - Enum constant in enum class org.sofabuffers.sofab.SofabError
-
The output buffer is full and no
FlushSinkis available. - bufferSet(byte[], int) - Method in class org.sofabuffers.sofab.OStream
-
Replace the active buffer (typically from within a flush sink), resuming writes at
offsetin the new buffer. - bytesUsed() - Method in class org.sofabuffers.sofab.OStream
-
Number of bytes written to the active buffer since the last flush.
C
- CALLER_CHECKED - Enum constant in enum class org.sofabuffers.sofab.Bound.Rule
-
The schema's
maxlen, already enforced by the caller at the same header, so no number travels. - checkBlobLength(int, Bound) - Static method in class org.sofabuffers.sofab.PayloadAcc
-
Refuse an announced
bloblength the receiver's cap does not admit. - checkIndex(int, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
The element-index rule, written once for all nine reservations — and published for the one site that has none to ride.
- checkStringLength(int, Bound) - Static method in class org.sofabuffers.sofab.PayloadAcc
-
Refuse an announced
stringlength the receiver's cap does not admit — the §6.2.1 comparison on its own, for a caller to make at the length word. - COMPLETE - Enum constant in enum class org.sofabuffers.sofab.DecodeStatus
-
The consumed bytes end exactly at a field boundary — a valid message.
- copyOfBytesUsed() - Method in class org.sofabuffers.sofab.OStream
-
An exact-size copy of
[0, bytesUsed())— the bytes standing in the active buffer.
D
- decode(byte[], int, int) - Static method in class org.sofabuffers.sofab.Utf8
-
Materialize
b[off, off + len)as aString, rejecting a range that is not well-formed UTF-8. - DecodeStatus - Enum Class in org.sofabuffers.sofab
-
The outcome of a decode, per the finish-less three-valued model of CORELIB_PLAN §5.2.1 / MESSAGE_SPEC §7.
E
- EMPTY_BYTES - Static variable in class org.sofabuffers.sofab.Seq
-
Shared zero-length arrays.
- EMPTY_DOUBLES - Static variable in class org.sofabuffers.sofab.Seq
-
The shared empty
double[]; seeSeq.EMPTY_BYTES. - EMPTY_FLOATS - Static variable in class org.sofabuffers.sofab.Seq
-
The shared empty
float[]; seeSeq.EMPTY_BYTES. - EMPTY_INTS - Static variable in class org.sofabuffers.sofab.Seq
-
The shared empty
int[]; seeSeq.EMPTY_BYTES. - EMPTY_LONGS - Static variable in class org.sofabuffers.sofab.Seq
-
The shared empty
long[]; seeSeq.EMPTY_BYTES. - EMPTY_SHORTS - Static variable in class org.sofabuffers.sofab.Seq
-
The shared empty
short[]; seeSeq.EMPTY_BYTES. - ensureCap(byte[], int, int) - Static method in class org.sofabuffers.sofab.Seq
-
Enlarge
aso indexican be written, doubling its length but never exceedingcap. - ensureCap(double[], int, int) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.ensureCap(byte[], int, int)for adouble[]. - ensureCap(float[], int, int) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.ensureCap(byte[], int, int)for afloat[]. - ensureCap(int[], int, int) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.ensureCap(byte[], int, int)for anint[]. - ensureCap(long[], int, int) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.ensureCap(byte[], int, int)for along[]. - ensureCap(short[], int, int) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.ensureCap(byte[], int, int)for ashort[]. - equals(Object) - Method in record class org.sofabuffers.sofab.Bound
-
Indicates whether some other object is "equal to" this one.
- error() - Method in exception class org.sofabuffers.sofab.SofabException
-
The error category that caused this exception.
- Example - Section in class org.sofabuffers.sofab.IStream
- Example - Section in class org.sofabuffers.sofab.OStream
F
- feed(byte[], int, int, Visitor) - Method in class org.sofabuffers.sofab.IStream
-
Feed a slice of encoded bytes, pushing decoded fields to
visitor, and report where the decode stands. - feed(byte[], Visitor) - Method in class org.sofabuffers.sofab.IStream
-
Feed a whole chunk of encoded bytes, pushing decoded fields to
visitor, and report where the decode stands. - fixlenBegin(int, FixlenType, int) - Method in interface org.sofabuffers.sofab.Visitor
-
Start of a fixlen field — string, blob, fp32 or fp64.
- FixlenType - Enum Class in org.sofabuffers.sofab
-
Sub-type of a fixed-length field — the 3-bit tag encoded in the low bits of a fixlen length header (see the SofaBuffers documentation, "Fixlen Length and Type").
- flush() - Method in class org.sofabuffers.sofab.OStream
-
Flush any pending bytes to the sink (if one is set) and report how many bytes were pending.
- flush(byte[], int, int) - Method in interface org.sofabuffers.sofab.FlushSink
-
Consume
lengthbytes starting atoffsetindata. - FlushSink - Interface in org.sofabuffers.sofab
-
Sink that receives buffered bytes when an
OStream's buffer fills (or whenOStream.flush()is called). - fp32(int, float) - Method in interface org.sofabuffers.sofab.Visitor
-
A 32-bit float field, or an
fp32array element. - FP32 - Enum constant in enum class org.sofabuffers.sofab.ArrayKind
-
IEEE-754 32-bit float elements, delivered through
Visitor.fp32(int, float). - FP32 - Enum constant in enum class org.sofabuffers.sofab.FixlenType
-
32-bit IEEE-754 float, little-endian on the wire.
- fp64(int, double) - Method in interface org.sofabuffers.sofab.Visitor
-
A 64-bit float field, or an
fp64array element. - FP64 - Enum constant in enum class org.sofabuffers.sofab.ArrayKind
-
IEEE-754 64-bit double elements, delivered through
Visitor.fp64(int, double). - FP64 - Enum constant in enum class org.sofabuffers.sofab.FixlenType
-
64-bit IEEE-754 double, little-endian on the wire.
H
- hashCode() - Method in record class org.sofabuffers.sofab.Bound
-
Returns a hash code value for this object.
I
- ID_MAX - Static variable in class org.sofabuffers.sofab.Sofab
-
Largest valid field id,
2^31 - 1(INT32_MAX). - INCOMPLETE - Enum constant in enum class org.sofabuffers.sofab.DecodeStatus
-
The consumed bytes end inside a field or with an open sequence; more bytes could complete the message.
- invalid(String) - Static method in class org.sofabuffers.sofab.Sofab
-
The carrier a
Visitorrejects malformed input through: anSofabError.INVALID_MSGSofabException, wrapped so it can leave a callback that declares no checked exception. - INVALID - Enum constant in enum class org.sofabuffers.sofab.DecodeStatus
-
The bytes are malformed regardless of what follows — the third outcome of §5.2.1, and the one
IStream.feed(byte[], Visitor)does not return: it throws aSofabExceptionwithSofabError.INVALID_MSGinstead, then latches the verdict so no continuation can revise it and every furtherfeedthrows again untilIStream.reset(). - INVALID_MSG - Enum constant in enum class org.sofabuffers.sofab.SofabError
-
The input bytes are not a valid Sofab message (varint overflow, bad type tag, zero-length array, dangling sequence end, ...).
- IStream - Class in org.sofabuffers.sofab
-
Streaming SofaBuffers decoder.
- IStream() - Constructor for class org.sofabuffers.sofab.IStream
-
Create a fresh decoder ready to accept a new message.
L
- LIMIT_EXCEEDED - Enum constant in enum class org.sofabuffers.sofab.SofabError
-
A well-formed message field exceeds a receiver-configured decode limit for an unbounded (dynamic) field — one whose schema declares no
count/maxlen. - limitExceeded(String) - Static method in class org.sofabuffers.sofab.Sofab
-
The carrier a receiver-side limit (§6.2.1) is refused through: a
SofabError.LIMIT_EXCEEDEDSofabException, wrapped likeSofab.invalid(String)so it can leave a callback that declares no checked exception.
M
- max() - Method in record class org.sofabuffers.sofab.Bound
-
Returns the value of the
maxrecord component. - MAX_DEPTH - Static variable in class org.sofabuffers.sofab.Sofab
-
Maximum nested-sequence depth (§4.9 / §6.2).
- MIN_OUTPUT_BUFFER - Static variable in class org.sofabuffers.sofab.Sofab
-
Smallest output buffer this port accepts for streaming (CORELIB_PLAN §5.1).
O
- orEmpty(List) - Static method in class org.sofabuffers.sofab.Seq
-
The null-absorbing identity a wrapper array is read through on the encode side — by the serialize loop and by the all-default predicate alike.
- org.sofabuffers.sofab - package org.sofabuffers.sofab
-
SofaBuffers (Sofab) core stream library for Java — a dependency-free, allocation-light, streaming implementation of the SofaBuffers serialization format.
- OStream - Class in org.sofabuffers.sofab
-
Streaming SofaBuffers encoder writing into a caller-provided byte buffer.
- OStream(byte[]) - Constructor for class org.sofabuffers.sofab.OStream
-
Create an encoder over
bufferwith no flush sink. - OStream(byte[], int) - Constructor for class org.sofabuffers.sofab.OStream
-
Like
OStream(byte[])but begin writing atoffsetbytes into the buffer, reserving room for a lower-layer header. - OStream(byte[], int, FlushSink) - Constructor for class org.sofabuffers.sofab.OStream
-
Create an encoder with a flush
sink. - overScratch(int) - Static method in class org.sofabuffers.sofab.OStream
-
An encoder over a per-thread scratch buffer of at least
sizebytes — the mechanism behind a one-shotencode()that returns a fresh array without re-allocating (and re-zeroing) a worst-case buffer per call.
P
- PayloadAcc - Class in org.sofabuffers.sofab
-
Reassembles a
stringorblobpayload that arrives in more than one piece — the support layer, not the codec. - PayloadAcc() - Constructor for class org.sofabuffers.sofab.PayloadAcc
-
A fresh accumulator, holding no payload and no buffer.
- placeElem(List, int, T, T, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
Place a leaf element — a wrapper array's
stringorblob— at the index its wire id names, growing the list and filling the gaps that omitted interior elements left (MESSAGE_SPEC §5.1, §2).
R
- raw() - Method in enum class org.sofabuffers.sofab.FixlenType
-
The 3-bit wire tag for this sub-type.
- receiver(long) - Static method in record class org.sofabuffers.sofab.Bound
-
The receiver cap this deployment configured for a field the schema leaves unbounded — one of the three
max_dyn_*limits of §6.2.1. - RECEIVER - Enum constant in enum class org.sofabuffers.sofab.Bound.Rule
-
The deployment's receiver cap, compared by the call:
SofabError.LIMIT_EXCEEDEDpast it. - reserveElem(List, int, Supplier, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
Reserve a framed element — the slot a wrapper array's
struct,unionor nested-array element is routed into: bound the index, then grow the list toid + 1, giving each new slot its own element frommake(MESSAGE_SPEC §5.1, §2). - reserveRow(List, int, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
Reserve the row at index
idof a matrix — an array whose elements are themselves arrays — as an empty row, growing the outer list with empty rows so that a gap in the ids decodes as an empty row instead of shifting every later row down by one. - reserveRowBytes(List, int, int, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.reserveRow(List, int, Bound)for a primitive row: the same id-keyed placement and the same gap fill with the empty row, but the new row is handed back so the caller can fill it by index instead of reading it out of the list once per element. - reserveRowDoubles(List, int, int, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.reserveRowBytes(List, int, int, Bound)for adouble[]row. - reserveRowFloats(List, int, int, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.reserveRowBytes(List, int, int, Bound)for afloat[]row. - reserveRowInts(List, int, int, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.reserveRowBytes(List, int, int, Bound)for anint[]row. - reserveRowLongs(List, int, int, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.reserveRowBytes(List, int, int, Bound)for along[]row. - reserveRowShorts(List, int, int, Bound) - Static method in class org.sofabuffers.sofab.Seq
-
Seq.reserveRowBytes(List, int, int, Bound)for ashort[]row. - reset() - Method in class org.sofabuffers.sofab.IStream
-
Return this decoder to its just-constructed state so it can decode another message.
- reset(byte[]) - Method in class org.sofabuffers.sofab.OStream
-
Return this stream to its just-constructed state, writing into
bufferfrom its start, so a caller encoding many messages in a row (a server loop, the generatedencodehelper) can hold one instance instead of letting each encode allocate and immediately discard one. - reset(List) - Static method in class org.sofabuffers.sofab.Seq
-
Empty a list in place, keeping its capacity, and materialize one only when the field is null.
- rule() - Method in record class org.sofabuffers.sofab.Bound
-
Returns the value of the
rulerecord component.
S
- schema(long) - Static method in record class org.sofabuffers.sofab.Bound
-
The bound the schema declares for this field — an array's
count, or astring/blob'smaxlen— compared by the call it is handed to. - SCHEMA - Enum constant in enum class org.sofabuffers.sofab.Bound.Rule
- SCHEMA_BOUNDED - Static variable in record class org.sofabuffers.sofab.Bound
-
The schema bounds this
stringorbloband the caller has already enforced itsmaxlenat the same header, asSofab.invalid(String)(MESSAGE_SPEC §7.1), so §6.2.1 forbids a receiver cap on it and there is no second number forPayloadAccto compare. - Seq - Class in org.sofabuffers.sofab
-
Element placement and array growth for generated decode destinations — the support layer, not the codec.
- sequenceBegin(int) - Method in interface org.sofabuffers.sofab.Visitor
-
Start of a nested sequence (a new id scope).
- sequenceEnd() - Method in interface org.sofabuffers.sofab.Visitor
-
End of the current nested sequence.
- signed(int, long) - Method in interface org.sofabuffers.sofab.Visitor
-
A signed-integer field, or a signed array element.
- SIGNED - Enum constant in enum class org.sofabuffers.sofab.ArrayKind
-
Signed-integer elements, delivered through
Visitor.signed(int, long). - Sofab - Class in org.sofabuffers.sofab
-
Library-level constants for the SofaBuffers (
sofab) core. - SofabError - Enum Class in org.sofabuffers.sofab
-
Error categories raised by the encoder and decoder.
- SofabException - Exception Class in org.sofabuffers.sofab
-
Thrown by the encoder and decoder on protocol or buffer errors.
- SofabException(SofabError) - Constructor for exception class org.sofabuffers.sofab.SofabException
-
Create an exception for the given error category.
- SofabException(SofabError, String) - Constructor for exception class org.sofabuffers.sofab.SofabException
-
Create an exception for the given error category with extra detail.
- string(int, int, byte[], int, int, Bound) - Method in class org.sofabuffers.sofab.PayloadAcc
-
Offer a chunk of a
stringpayload; returns the decoded string once the last chunk has arrived,nullwhile more are expected. - string(int, int, int, byte[], int, int) - Method in interface org.sofabuffers.sofab.Visitor
-
A chunk of a string field (raw UTF-8 bytes, no NUL terminator).
- STRING - Enum constant in enum class org.sofabuffers.sofab.FixlenType
-
UTF-8 / raw text, no NUL terminator on the wire.
T
- toString() - Method in record class org.sofabuffers.sofab.Bound
-
A short description naming which rule this states, for diagnostics.
U
- unsigned(int, long) - Method in interface org.sofabuffers.sofab.Visitor
-
An unsigned-integer field, or an unsigned array element.
- UNSIGNED - Enum constant in enum class org.sofabuffers.sofab.ArrayKind
-
Unsigned-integer elements, delivered through
Visitor.unsigned(int, long). - Utf8 - Class in org.sofabuffers.sofab
-
UTF-8 validation — and, on the decode side, materialization — of a raw byte range, for both sides of a
stringfield (CORELIB_PLAN §6.4).
V
- valid(byte[], int, int) - Static method in class org.sofabuffers.sofab.Utf8
-
Reports whether
b[i..end)is well-formed UTF-8. - valueOf(String) - Static method in enum class org.sofabuffers.sofab.ArrayKind
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.sofabuffers.sofab.Bound.Rule
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.sofabuffers.sofab.DecodeStatus
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.sofabuffers.sofab.FixlenType
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.sofabuffers.sofab.SofabError
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class org.sofabuffers.sofab.ArrayKind
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.sofabuffers.sofab.Bound.Rule
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.sofabuffers.sofab.DecodeStatus
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.sofabuffers.sofab.FixlenType
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.sofabuffers.sofab.SofabError
-
Returns an array containing the constants of this enum class, in the order they are declared.
- Visitor - Interface in org.sofabuffers.sofab
-
Receives decoded fields pushed by an
IStream.
W
- writeArrayFp32(int, float[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of 32-bit floats.
- writeArrayFp64(int, double[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of 64-bit floats.
- writeArraySigned(int, byte[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of signed 8-bit integers.
- writeArraySigned(int, int[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of signed 32-bit integers.
- writeArraySigned(int, long[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of signed 64-bit integers.
- writeArraySigned(int, short[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of signed 16-bit integers.
- writeArrayUnsigned(int, byte[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of unsigned 8-bit integers (each element zero-extended).
- writeArrayUnsigned(int, int[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of unsigned 32-bit integers (each element zero-extended).
- writeArrayUnsigned(int, long[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of unsigned 64-bit integers (each
longtreated as an unsigned value). - writeArrayUnsigned(int, short[]) - Method in class org.sofabuffers.sofab.OStream
-
Write an array of unsigned 16-bit integers (each element zero-extended).
- writeBlob(int, byte[]) - Method in class org.sofabuffers.sofab.OStream
-
Write a binary blob field.
- writeBlob(int, byte[], int, int) - Method in class org.sofabuffers.sofab.OStream
-
Write a slice of a byte array as a binary blob field.
- writeBoolean(int, boolean) - Method in class org.sofabuffers.sofab.OStream
-
Write a boolean as an unsigned
0/1. - writeFixlen(int, byte[], int, int, FixlenType) - Method in class org.sofabuffers.sofab.OStream
-
Write a fixed-length field: the id header, a
(len << 3) | subtypelength header, thenlengthraw bytes fromdata(already in wire / little-endian order for floats). - writeFp32(int, float) - Method in class org.sofabuffers.sofab.OStream
-
Write a 32-bit float field.
- writeFp64(int, double) - Method in class org.sofabuffers.sofab.OStream
-
Write a 64-bit float field.
- writeSequenceBeginLazy(int) - Method in class org.sofabuffers.sofab.OStream
-
Open a nested sequence with the given field
id, whose header is held back until the sequence turns out to have content. - writeSequenceEnd() - Method in class org.sofabuffers.sofab.OStream
-
Close the most recently opened nested sequence, letting it vanish if it received no content.
- writeSequenceEndKeep() - Method in class org.sofabuffers.sofab.OStream
-
Close the most recently opened nested sequence, keeping its frame even when it received no content.
- writeSigned(int, long) - Method in class org.sofabuffers.sofab.OStream
-
Write a signed-integer field (ZigZag + varint).
- writeString(int, String) - Method in class org.sofabuffers.sofab.OStream
-
Write a string field (raw UTF-8 bytes, no NUL on the wire).
- writeString(int, String, int) - Method in class org.sofabuffers.sofab.OStream
-
Write a string field whose UTF-8 byte length must not exceed
maxlen. - writeUnsigned(int, long) - Method in class org.sofabuffers.sofab.OStream
-
Write an unsigned-integer field.
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form