Skip to content

Commit 39cf02f

Browse files
committed
🔄 synced local 'docs/specification/' with remote 'docs/specification/'
1 parent 91eec99 commit 39cf02f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎docs/specification/xlang_serialization_spec.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,7 @@ Here is the overall format:
243243
| fory header | object ref meta | object type meta | object value data |
244244
```
245245

246-
The data are serialized using little endian byte order overall. If bytes swap is costly for some object,
247-
Fory will write the byte order for that object into the data instead of converting it to little endian.
246+
The data are serialized using little endian byte order for all types.
248247

249248
## Fory header
250249

@@ -261,18 +260,19 @@ Detailed byte layout:
261260
```
262261
Byte 0: Bitmap flags
263262
- Bit 0: null flag (0x01)
264-
- Bit 1: endian flag (0x02)
265-
- Bit 2: xlang flag (0x04)
266-
- Bit 3: oob flag (0x08)
267-
- Bits 4-7: reserved
263+
- Bit 1: xlang flag (0x02)
264+
- Bit 2: oob flag (0x04)
265+
- Bits 3-7: reserved
268266
Byte 1: Language ID (only present when xlang flag is set)
269267
Byte 2-5: Meta start offset (only present when meta share mode is enabled)
270268
```
271269

272-
- **null flag** (bit 0): 1 when object is null, 0 otherwise. If an object is null, only this flag and endian flag are set.
273-
- **endian flag** (bit 1): 1 when data is encoded by little endian, 0 for big endian. Modern implementations always use little endian.
274-
- **xlang flag** (bit 2): 1 when serialization uses Fory xlang format, 0 when serialization uses Fory language-native format.
275-
- **oob flag** (bit 3): 1 when out-of-band serialization is enabled (BufferCallback is not null), 0 otherwise.
270+
- **null flag** (bit 0): 1 when object is null, 0 otherwise. If an object is null, only this flag is set.
271+
- **xlang flag** (bit 1): 1 when serialization uses Fory xlang format, 0 when serialization uses Fory language-native format.
272+
- **oob flag** (bit 2): 1 when out-of-band serialization is enabled (BufferCallback is not null), 0 otherwise.
273+
274+
All data is encoded in little-endian format.
275+
276276
- **language**: 1 byte indicating the source language. This allows deserializers to optimize for specific language characteristics.
277277

278278
### Language IDs

0 commit comments

Comments
 (0)