Comparison of data-serialization formats
{{Short description|None}}
This is a comparison of data serialization formats, various ways to convert complex objects to sequences of bits. It does not include markup languages used exclusively as document file formats.
Overview
{{sort-under}}
class="wikitable sortable sort-under mw-collapsible" |
Name
! Creator-maintainer ! Based on ! Standardized?{{definition needed|date=January 2021}} ! Binary? ! Supports references?{{ref|stdrefs|e}} ! Schema-IDL? ! Standard APIs ! Supports zero-copy operations |
---|
Apache Arrow
| {{n/a}} | {{partial|De facto}} | [https://arrow.apache.org/docs/format/Columnar.html Arrow Columnar Format] | {{yes}} | {{no}} | {{yes}} | {{yes|Built-in}} | C, C++, C#, Go, Java, JavaScript, Julia, Matlab, Python, R, Ruby, Rust, Swift | {{yes}} |
Apache Avro
| {{n/a}} | {{no}} | [https://avro.apache.org/docs/current/spec.html Apache Avro™ Specification] | {{yes}} | {{partial}}{{ref|avrojson|g}} | {{n/a}} | {{yes|Built-in}} | C, C#, C++, Java, PHP, Python, Ruby | {{n/a}} |
Apache Parquet
| {{n/a}} | {{no}} | [https://parquet.apache.org Apache Parquet] | {{yes}} | {{no}} | {{no}} | {{n/a}} | Java, Python, C++ | {{no}} |
Apache Thrift
| Facebook (creator) | {{n/a}} | {{no}} | [http://thrift.apache.org/static/files/thrift-20070401.pdf Original whitepaper] | {{yes}} | {{partial}}{{ref|thrifttxt|c}} | {{no}} | {{yes|Built-in}} | C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml, Delphi and other languages[https://thrift.apache.org/ Apache Thrift] | {{n/a}} |
ASN.1
| {{n/a}} | {{yes}} | ISO/IEC 8824 / ITU-T X.680 (syntax) and ISO/IEC 8825 / ITU-T X.690 (encoding rules) series. X.680, X.681, and X.683 define syntax and semantics. | {{yes|BER, DER, PER, OER, or custom via ECN}} | {{yes|XER, JER, GSER, or custom via ECN}} | {{yes}}{{ref|asn1refs|f}} | {{yes|Built-in}} | {{n/a}} | {{yes|OER}} |
Bencode
| Bram Cohen (creator) | {{n/a}} | {{yes| De facto as {{abbr|BEP|BitTorrent Enhancement Proposal}}}} | Part of [http://bittorrent.org/beps/bep_0003.html BitTorrent protocol specification] | {{partial|Except numbers and delimiters, being ASCII}} | {{no}} | {{no}} | {{no}} | {{no}} | {{no}} |
BSON
| MongoDB | JSON | {{no}} | [http://bsonspec.org BSON Specification] | {{yes}} | {{no}} | {{no}} | {{no}} | {{no}} | {{no}} |
Cap%27n Proto
| Kenton Varda | {{n/a}} | {{no}} | [https://capnproto.org/encoding.html Cap'n Proto Encoding Spec] | {{yes}} | {{partial}}{{ref|capnptextformat|h}} | {{no}} | {{yes}} | {{no}} | {{yes}} |
CBOR
| Carsten Bormann, P. Hoffman | MessagePack{{cite web|url=https://github.com/msgpack/msgpack/issues/258#issuecomment-449978394|title=CBOR relationship with msgpack|first1=Carsten|last1=Bormann|website=GitHub |date=2018-12-26|access-date=2023-08-14}} | {{yes}} | RFC 8949 | {{yes}} | {{no}} | {{yes}}, | {{yes|[https://tools.ietf.org/html/rfc8610 CDDL]}} | {{yes|FIDO2}} | {{no}} |
Comma-separated values (CSV)
| RFC author: | {{n/a}} | {{partial|Myriad informal variants}} | RFC 4180 | {{no}} | {{yes}} | {{no}} | {{no}} | {{no}} | {{no}} |
Common Data Representation (CDR)
| {{n/a}} | {{yes}} | {{yes}} | {{no}} | {{yes}} | {{yes}} | Ada, C, C++, Java, Cobol, Lisp, Python, Ruby, Smalltalk | {{n/a}} |
D-Bus Message Protocol
| {{n/a}} | {{yes}} | [https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol D-Bus Specification] | {{yes}} | {{no}} | {{no}} | {{partial}} | {{yes|Yes}} | {{n/a}} |
Efficient XML Interchange (EXI)
| W3C | XML, Efficient XML | {{Yes}} | [https://www.w3.org/TR/exi/ Efficient XML Interchange (EXI) Format 1.0] | {{Yes}} | {{yes|XML}} | {{Yes|XML Schema}} | {{Yes|DOM, SAX, StAX, XQuery, XPath}} | {{n/a}} |
Extensible Data Notation (edn)
| Rich Hickey / Clojure community | Clojure | {{yes}} | [https://github.com/edn-format/edn Official edn spec] | {{no}} | {{yes}} | {{no}} | {{no}} | Clojure, Ruby, Go, C++, Javascript, Java, CLR, ObjC, Python{{cite web|url=https://github.com/edn-format/edn/wiki/Implementations|title=Implementations|website=GitHub }} | {{no}} |
FlatBuffers
| {{n/a}} | {{no}} | [https://google.github.io/flatbuffers/ Flatbuffers GitHub] | {{yes}} | {{yes|Apache Arrow}} | {{partial}} | {{yes|[https://google.github.io/flatbuffers/flatbuffers_guide_writing_schema.html Yes]}} | C++, Java, C#, Go, Python, Rust, JavaScript, PHP, C, Dart, Lua, TypeScript | {{yes}} |
Fast Infoset
| XML | {{yes}} | ITU-T X.891 and ISO/IEC 24824-1:2007 | {{yes}} | {{no}} | {{yes|XML schema}} | {{yes|DOM, SAX, XQuery, XPath}} | {{n/a}} |
FHIR
| REST basics | {{Yes}} | Fast Healthcare Interoperability Resources | {{Yes}} | {{Yes}} | {{Yes}} | {{Yes}} | Hapi for FHIR{{cite web|url=http://hapifhir.io/|title=HAPI FHIR - The Open Source FHIR API for Java|website=hapifhir.io}} JSON, XML, Turtle | {{no}} |
Ion
| Amazon | JSON | {{no}} | [https://amzn.github.io/ion-docs/spec.html The Amazon Ion Specification] | {{yes}} | {{yes}} | {{no}} | {{Yes|[https://amzn.github.io/ion-schema/ Ion schema]}} | C, C#, Go, Java, JavaScript, Python, Rust | {{n/a}} |
Java serialization
| {{n/a}} | {{yes}} | [https://docs.oracle.com/javase/8/docs/technotes/guides/serialization/index.html Java Object Serialization] | {{yes}} | {{no}} | {{yes}} | {{no}} | {{yes}} | {{n/a}} |
JSON
| {{yes}} | [https://tools.ietf.org/html/std90 STD 90]/RFC 8259 | {{no}}, but see BSON, Smile, UBJSON | {{yes}} | {{yes|[https://tools.ietf.org/html/rfc6901 JSON Pointer (RFC{{nbsp}}6901)], or alternately, [http://goessner.net/articles/JsonPath/ JSONPath], [https://web.archive.org/web/20120922110739/http://bluelinecity.com/software/jpath/ JPath], [https://web.archive.org/web/20121203081945/http://www.jspon.org/ JSPON], [https://github.com/lloyd/JSONSelect json:select()]; and JSON-LD}} | {{partial}} | {{partial}} | {{no}} |
MessagePack
| Sadayuki Furuhashi | JSON (loosely) | {{no}} | [https://github.com/msgpack/msgpack/blob/master/spec.md MessagePack format specification] | {{yes}} | {{no}} | {{no}} | {{no}} | {{no}} | {{yes}} |
Netstrings
| {{n/a}} | {{no}} | [http://cr.yp.to/proto/netstrings.txt netstrings.txt] | {{partial|Except ASCII delimiters}} | {{yes}} | {{no}} | {{no}} | {{no}} | {{yes}} |
OGDL
| Rolf Veen | {{dunno}} | {{no}} | [http://ogdl.org/spec/ Specification] | {{yes|[http://ogdl.org/spec/binary.html Binary specification]}} | {{yes}} | {{yes|[http://ogdl.org/spec/path.html Path specification]}} | {{yes|[http://ogdl.org/spec/schema.html Schema WD]}} | | {{n/a}} |
OPC-UA Binary
| {{n/a}} | {{no}} | [https://opcfoundation.org opcfoundation.org] | {{yes}} | {{no}} | {{yes}} | {{no}} | {{no}} | {{n/a}} |
OpenDDL
| {{no}} | [http://openddl.org/ OpenDDL.org] | {{no}} | {{yes}} | {{yes}} | {{no}} | {{yes|[http://openddl.org/ OpenDDL library]}} | {{n/a}} |
PHP serialization format
| PHP Group | {{n/a}} | {{yes}} | {{no}} | {{yes}} | {{yes}} | {{yes}} | {{no}} | {{yes}} | {{n/a}} |
Pickle (Python)
| Python | {{yes|De facto as PEPs}} | [https://www.python.org/dev/peps/pep-3154/ PEP 3154 – Pickle protocol version 4] | {{yes}} | {{no}} | {{yes}}[https://github.com/python/cpython/blob/v3.9.0/Lib/pickle.py#L137-L144 cpython/Lib/pickle.py] | {{no}} | {{yes}} | {{no}} |
Property list
| NeXT (creator) | {{dunno}} | {{partial}} | [https://www.apple.com/DTDs/PropertyList-1.0.dtd Public DTD for XML format] | {{yes}}{{ref|plbin|a}} | {{yes}}{{ref|pltxt|b}} | {{no}} | {{dunno}} | [https://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/PropertyLists/Introduction/Introduction.html Cocoa], [https://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFPropertyLists/CFPropertyLists.html CoreFoundation], [https://web.archive.org/web/20081210064322/http://docs.sun.com/app/docs/doc/802-2112/6i63mn65o?a=view OpenStep], [https://web.archive.org/web/20110519164921/http://gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html GnuStep] | {{no}} |
Protocol Buffers (protobuf)
| {{n/a}} | {{no}} | [https://developers.google.com/protocol-buffers/docs/encoding Developer Guide: Encoding], [https://developers.google.com/protocol-buffers/docs/reference/proto2-spec proto2 specification], and [https://developers.google.com/protocol-buffers/docs/reference/proto3-spec proto3 specification] | {{yes}} | {{yes}}{{ref|pbtextformat|d}} | {{no}} | {{yes|Built-in}} | C++, Java, C#, Python, Go, Ruby, Objective-C, C, Dart, Perl, PHP, R, Rust, Scala, Swift, Julia, Erlang, D, Haskell, ActionScript, Delphi, Elixir, Elm, Erlang, GopherJS, Haskell, Haxe, JavaScript, Kotlin, Lua, Matlab, Mercurt, OCaml, Prolog, Solidity, Typescript, Vala, Visual Basic | {{no}} |
{{nobr|S-expressions}}
| John McCarthy (original) | {{partial|Largely de facto}} | [http://people.csail.mit.edu/rivest/Sexp.txt "S-Expressions"] {{Webarchive|url=https://web.archive.org/web/20131007024815/http://people.csail.mit.edu/rivest/Sexp.txt |date=2013-10-07 }} Internet Draft | {{yes}}, canonical representation | {{yes}}, advanced transport representation | {{no}} | {{no}} | | {{n/a}} |
Smile
| Tatu Saloranta | JSON | {{no}} | [https://github.com/FasterXML/smile-format-specification Smile Format Specification] | {{yes}} | {{no}} | {{yes}} | {{partial}} | {{partial}} | {{n/a}} |
SOAP
| W3C | XML | {{yes}} | {{nobr|W3C Recommendations:}} | {{partial}} | {{yes}} | {{yes|Built-in id/ref, XPointer, XPath}} | {{yes|WSDL, XML schema}} | {{yes|DOM, SAX, XQuery, XPath}} | {{n/a}} |
{{nobr|Structured Data eXchange Formats}}
| {{n/a}} | {{yes}} | RFC 3072 | {{yes}} | {{no}} | {{no}} | {{no}} | | {{n/a}} |
UBJSON
| The Buzz Media, LLC | {{no}} | [http://ubjson.org/ ubjson.org] | {{yes}} | {{no}} | {{no}} | {{no}} | {{no}} | {{n/a}} |
eXternal Data Representation (XDR)
| Sun Microsystems (creator) | {{n/a}} | {{yes}} | [https://tools.ietf.org/html/std67 STD 67]/RFC 4506 | {{yes}} | {{no}} | {{yes}} | {{yes}} | {{yes}} | {{n/a}} |
XML
| W3C | SGML | {{yes}} | {{nobr|W3C Recommendations:}} | {{partial}} | {{yes}} | {{yes|XML schema, RELAX NG}} | {{yes|DOM, SAX, XQuery, XPath}} | {{n/a}} |
XML-RPC
| Dave Winer{{cite web|url=https://www.xml.com/pub/a/ws/2001/04/04/soap.html|title=A Brief History of SOAP|website=www.xml.com}} | XML | {{no}} | [http://xmlrpc.com/spec.md XML-RPC Specification] | {{no}} | {{yes}} | {{no}} | {{no}} | {{no}} | {{no}} |
YAML
| Clark Evans, | C, Java, Perl, Python, Ruby, Email, HTML, MIME, URI, XML, SAX, SOAP, JSON{{cite web|url=http://yaml.org/spec/1.2/spec.html#id2708710|title=YAML Ain't Markup Language (YAML) Version 1.2|first1=Oren |last1=Ben-Kiki |first2=Clark |last2=Evans |first3=Ingy döt |last3=Net|date=2009-10-01|work=The Official YAML Web Site|access-date=2012-02-10}} | {{no}} | [http://www.yaml.org/spec/1.2/spec.html Version 1.2] | {{no}} | {{yes}} | {{yes}} | {{partial}} | {{no}} | {{no}} |
Name
! Creator-maintainer ! Based on ! Standardized? ! Binary? ! Supports references?{{ref|stdrefs|e}} ! Schema-IDL? ! Standard APIs ! Supports zero-copy operations |
{{ordered list
| list-style-type=lower-alpha
| {{note|plbin}}The current default format is binary.
| {{note|pltxt}}The "classic" format is plain text, and an XML format is also supported.
| {{note|thrifttxt}}Theoretically possible due to abstraction, but no implementation is included.
| {{note|pbtextformat}}The primary format is binary, but text and JSON formats are available.{{cite web|url=https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.text_format|title=text_format.h - Protocol Buffers|website=Google Developers}}{{cite web|url=https://developers.google.com/protocol-buffers/docs/proto3#json|title=JSON Mapping - Protocol Buffers|website=Google Developers}}
| {{note|stdrefs}}Means that generic tools/libraries know how to encode, decode, and dereference a reference to another piece of data in the same document. A tool may require the IDL file, but no more. Excludes custom, non-standardized referencing techniques.
| {{note|asn1refs}}ASN.1 has X.681 (Information Object System), X.682 (Constraints), and X.683 (Parameterization) that allow for the precise specification of open types where the types of values can be identified by integers, by OIDs, etc. OIDs are a standard format for globally unique identifiers, as well as a standard notation ("absolute reference") for referencing a component of a value. For example, PKIX uses such notation in RFC 5912. With such notation (constraints on parameterized types using information object sets), generic ASN.1 tools/libraries can automatically encode/decode/resolve references within a document.
| {{note|avrojson}}The primary format is binary, a json encoder is available.{{cite web|url=https://avro.apache.org/docs/1.9.2/spec.html#json_encoding|title=Avro Json Format}}
| {{note|capnptextformat}}The primary format is binary, but a text format is available.
}}
Syntax comparison of human-readable formats
class="wikitable" |
Format
! Null ! Boolean true ! Boolean false ! Integer ! String ! Array |
---|
ASN.1 (XML Encoding Rules) | {{nobr| | | | | | {{nobr| | | An object (the key is a field name): A data mapping (the key is a data value): {{ref|guess|a}} |
CSV{{ref|csvguess|b}}
| | | | | | {{nobr| | | 42,1 |
edn
| | | | | | | | |
Format
! Null ! Boolean true ! Boolean false ! Integer ! String ! Array |
Ion
|
| | | | | | [true, null, -42.1e7, "A to Z"] | {'42': true, 'A to Z': [1, 2, 3]} |
Netstrings{{ref|netguess|c}}
| | | | | | {{nobr| | | {{nobr| |
JSON
| | | | | | {{nobr| | [true, null, -42.1e7, "A to Z"] | {"42": true, "A to Z": [1, 2, 3]} |
OGDL{{Verify source|date=September 2009}}
| | | | | | | true
| 42 42 |
Format
! Null ! Boolean true ! Boolean false ! Integer ! String ! Array |
OpenDDL
| | | | | | | Homogeneous array: int32 {1, 2, 3, 4, 5} Heterogeneous array: array | dict |
PHP serialization format
| | | | | | | |Associative array: |
Pickle (Python)
| | | | | | | | |
Property list (plain text format){{cite web|url=http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html|title=NSPropertyListSerialization class documentation|website=www.gnustep.org|access-date=2009-10-28|archive-url=https://web.archive.org/web/20110519164921/http://gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html|archive-date=2011-05-19|url-status=dead}} | {{n/a}} | | | | | | | { |
Property list (XML format){{cite web|url=https://developer.apple.com/library/archive/|title=Documentation Archive|website=developer.apple.com}} | {{n/a}} | | | | | {{nobr| | | |
Protocol Buffers
| {{n/a}} | | | | | | field1: "value1" anotherfield { | thing1: "blahblah" thing2: 18923743 thing3: -44 thing4 { submessage_field1: "foo" submessage_field2: false } enumeratedThing: SomeEnumeratedValue thing5: 123.456 [extensionFieldFoo]: "etc" [extensionFieldThatIsAnEnum]: EnumValue |
Format
! Null ! Boolean true ! Boolean false ! Integer ! String ! Array |
S-expressions
| | | | | | | | |
YAML
| |date=2005-01-18 |author1=Oren Ben-Kiki|author2=Clark Evans|author3=Brian Ingerson |access-date=2009-09-12}} | | | | | | - y | 42: y |
XML{{ref|xmlguess|e}} and SOAP
| {{nobr| | | | | | {{nobr| | | |
XML-RPC
| | | | | | | | |
{{ordered list
| list-style-type=lower-alpha
| {{note|guess}}Omitted XML elements are commonly decoded by XML data binding tools as NULLs. Shown here is another possible encoding; XML schema does not define an encoding for this datatype.
| {{note|csvguess}}The RFC CSV specification only deals with delimiters, newlines, and quote characters; it does not directly deal with serializing programming data structures.
| {{note|netguess}}The netstrings specification only deals with nested byte strings; anything else is outside the scope of the specification.
| {{note|phpfloat}}PHP will unserialize any floating-point number correctly, but will serialize them to their full decimal expansion. For example, 3.14 will be serialized to {{val|3.140000000000000124344978758017532527446746826171875}}.
| {{note|xmlguess}}XML data bindings and SOAP serialization tools provide type-safe XML serialization of programming data structures into XML. Shown are XML values that can be placed in XML elements and attributes.
| {{note|lispstd}}This syntax is not compatible with the Internet-Draft, but is used by some dialects of Lisp.
}}
Comparison of binary formats
class="wikitable" |
style="vertical-align:bottom;"
! Format ! Null ! Booleans ! Integer ! String ! Array |
style="vertical-align:top;"
| ASN.1 | {{mono|NULL}} type | {{mono|BOOLEAN}}: {{ubli | BER: as 1 byte in binary form; | PER: as 1 bit; | OER: as 1 byte }} | {{mono|INTEGER}}: {{ubli | BER: variable-length big-endian binary representation (up to 2{{sup|2{{sup|1024}}}} bits); | PER Unaligned: a fixed number of bits if the integer type has a finite range; a variable number of bits otherwise; | PER Aligned: a fixed number of bits if the integer type has a finite range and the size of the range is less than 65536; a variable number of octets otherwise; | OER: 1, 2, or 4 octets (either signed or unsigned) if the integer type has a finite range that fits in that number of octets; a variable number of octets otherwise }} | {{mono|REAL}}:{{ubli | base-10 real values are represented as character strings in ISO 6093 format; | binary real values are represented in a binary format that includes the mantissa, the base (2, 8, or 16), and the exponent; | the special values {{mono|NaN, -INF, +INF}}, and negative zero are also supported }} | Multiple valid types ({{mono|VisibleString, PrintableString, GeneralString, UniversalString, UTF8String}}) | Data specifications {{mono|SET OF}} (unordered) and {{mono|SEQUENCE OF}} (guaranteed order) | User definable type |
style="vertical-align:top;"
| BSON | | True: | int32: 32-bit little-endian 2's complement or int64: 64-bit little-endian 2's complement | Double: little-endian binary64 | UTF-8-encoded, preceded by int32-encoded string length in bytes | BSON embedded document with numeric keys | BSON embedded document |
style="vertical-align:top;"
| Concise Binary Object Representation (CBOR) | | {{ubli | True: | False: }} (1 byte) | {{ubli | Small positive/negative | 8-bit: positive | 16-bit: positive | 32-bit: positive | 64-bit: positive | Negative x encoded as (−x − 1) }} | {{ubli | IEEE half/single/double | Decimals and bigfloats (4+ bytes) encoded as }} | {{ubli | Length and content (1–9 bytes overhead) | Bytestring | UTF-8 | Indefinite partial strings }} | {{ubli | Length and items | Indefinite list }} | {{ubli | Length (in pairs) and items | Indefinite map }} |
style="vertical-align:top;"
| Efficient XML Interchange (EXI){{efn |group=binary |Any XML based representation can be compressed, or generated as, using EXI {{ndash}} {{Cite web |title=Efficient XML Interchange (EXI) Format 1.0 (Second Edition) |url=https://www.w3.org/TR/2014/REC-exi-20140211/Overview.html}}{{Cite web |title=Efficient Extensible Interchange |url=https://www.w3.org/XML/EXI/index.html}} {{ndash}} which is a "Schema Informed" (as opposed to schema-required, or schema-less) binary compression standard for XML.}} (Unpreserved lexical values format) | xsi:nil is not allowed in binary context. | 1–2 bit integer interpreted as boolean. | Boolean sign, plus arbitrary length 7-bit octets, parsed until most-significant bit is 0, in little-endian. The schema can set the zero-point to any arbitrary number. Unsigned skips the boolean flag. | {{ubli | Float: integer mantissa and integer exponent. | Decimal: boolean sign, integer whole value, integer fractional. }} | Length prefixed integer-encoded Unicode. Integers may represent enumerations or string table entries instead. | Length prefixed set of items. | {{No|Not in protocol.}} |
style="vertical-align:top;"
| Encoded as absence of field in parent object | {{ubli | True: | False: }} (1 byte) | Little-endian 2's complement signed and unsigned 8/16/32/64 bits | {{ubli | Floats: little-endian binary32 | Doubles: little-endian binary64 }} | UTF-8-encoded, preceded by 32-bit integer length of string in bytes | Vectors of any other type, preceded by 32-bit integer length of number of elements | Tables (schema defined types) or Vectors sorted by key (maps / dictionaries) |
style="vertical-align:top;"
| Ion[http://amzn.github.io/ion-docs/docs/binary.html Ion Binary Encoding] | | {{ubli | True: | False: }} | {{ubli | Positive | Zero is always encoded in tag byte. | BigInts over 13 bytes (104 bits) have 1+ byte overhead for length }} | {{ubli | | | Zero is always encoded in tag byte. }} | {{ubli | UTF-8: | Other strings: | Arbitrary length and overhead }} | | {{ubli | Structs (numbered fields): | Annotations (named fields): }} |
style="vertical-align:top;"
| | {{ubli | True: | False: }} | {{ubli | Single byte "fixnum" (values {{nowrap|−32 – 127}}) | or typecode (1 byte) + big-endian (u)int8/16/32/64 }} | Typecode (1 byte) + IEEE single/double | {{ubli | Typecode + up to 15 bytes | or typecode + length as uint8/16/32 + bytes; }} | {{ubli | As "fixarray" (single-byte prefix + up to 15 array items) | or typecode (1 byte) + 2–4 bytes length + array items }} | {{ubli | As "fixmap" (single-byte prefix + up to 15 key-value pairs) | or typecode (1 byte) + 2–4 bytes length + key-value pairs }} |
style="vertical-align:top;"
| Netstrings{{efn |group=binary |Interpretation of Netstrings is entirely application- or schema-dependent.}} | {{No|Not in protocol.}} | {{No|Not in protocol.}} | {{No|Not in protocol.}} | {{No|Not in protocol.}} | Length-encoded as an ASCII string + ':' + data + ',' Length counts only octets between ':' and ',' | {{No|Not in protocol.}} | {{No|Not in protocol.}} |
style="vertical-align:top;"
| OGDL Binary | | | | | | | |
style="vertical-align:top;"
| Property list | | | | | | | |
style="vertical-align:top;"
| | | {{ubli | Variable encoding length signed 32-bit: varint encoding of "ZigZag"-encoded value | Variable encoding length signed 64-bit: varint encoding of "ZigZag"-encoded | Constant encoding length 32-bit: 32 bits in little-endian 2's complement | Constant encoding length 64-bit: 64 bits in little-endian 2's complement }} | {{ubli | Floats: little-endian binary32 | Doubles: little-endian binary64 }} | UTF-8-encoded, preceded by varint-encoded integer length of string in bytes | Repeated value with the same tag or, for varint-encoded integers only, values packed contiguously and prefixed by tag and total byte length | {{n/a}} |
style="vertical-align:top;"
| Smile | | {{ubli | True: | False: }} | {{ubli | Single byte "small" (values {{nowrap|−16 – 15}} encoded as {{nowrap| | zigzag-encoded }} | IEEE single/double, | Length-prefixed "short" Strings (up to 64 bytes), marker-terminated "long" Strings and (optional) back-references | Arbitrary-length heterogenous arrays with end-marker | Arbitrary-length key/value pairs with end-marker |
style="vertical-align:top;"
| Structured Data eXchange Formats (SDXF) | | | Big-endian signed 24-bit or 32-bit integer | Big-endian IEEE double | Either UTF-8 or ISO 8859-1 encoded | List of elements with identical ID and size, preceded by array header with int16 length | Chunks can contain other chunks to arbitrary depth. |
style="vertical-align:top;"
| Thrift | | | | | | | |
{{notelist|group=binary}}
See also
References
{{reflist}}
External links
- [https://www.w3.org/TR/NOTE-xml-ql/ XML-QL Proposal discussing XML benefits]
- [https://www.xml.com/pub/a/2001/05/02/champion.html Daring to Do Less with XML]