|
Enhanced C#
Loyc library documentation
|
Options that control general behavior of SyncBinary.Reader and SyncBinary.Writer. Note: some behaviors such as deduplication (including support for cyclic references) are controlled at the level of individual fields, and such options are not duplicated here. More...
Options that control general behavior of SyncBinary.Reader and SyncBinary.Writer. Note: some behaviors such as deduplication (including support for cyclic references) are controlled at the level of individual fields, and such options are not duplicated here.
Reader and Writer do not make a copy of this object before using it, and it is possible to change these options after constructing the reader/writer and have those changes take effect somewhere in the middle of a file stream. In fact, changing the options mid-file is sometimes required to support (for example) file formats that use multiple integer formats. However, if you change these options while writing an object, remember to change them back to their previous state before returning to the parent object. If you fail to restore the previous state expected by the parent object, you may cause the parent object to corrupt the output stream (when writing) or misinterpret the stream and receive corrupted data (when reading).
Nested classes | |
| class | ForReader |
| class | ForWriter |
Properties | |
| int | MaxNumberSize [get, set] |
Maximum size of large numbers, in bytes. The default is 1 MB, or about (BigInteger)0x7F << (8 * 1024 * 1024). An exception occurs if you try to serialize or deserialize a number larger than this. More... | |
| Markers | Markers = 1024 * 1024 + 1 [get, set] |
| Controls the set of markers that are written or expected in the binary data stream. The main purpose of markers is simply to increase the chance that when a data stream is being read incorrectly (because you are not reading exactly the same fields/types that were written) an exception will occur soon afterward. In addition, list markers allow you to toggle the ObjectMode.Deduplicate flag on an object or list field (but not a tuple field) without breaking compatibility. Markers increase the data size, however. More... | |
| ObjectMode | RootMode = Markers.Default [get, set] |
| The ObjectMode used to read/write the root object. This option has no effect if you are using NewWriter or NewReader. More... | |
| ForWriter | Write = ObjectMode.Normal [get, set] |
| ForReader | Read [get, set] |
|
getset |
Controls the set of markers that are written or expected in the binary data stream. The main purpose of markers is simply to increase the chance that when a data stream is being read incorrectly (because you are not reading exactly the same fields/types that were written) an exception will occur soon afterward. In addition, list markers allow you to toggle the ObjectMode.Deduplicate flag on an object or list field (but not a tuple field) without breaking compatibility. Markers increase the data size, however.
Changing this property is, itself, a breaking change to the data stream.
|
getset |
Maximum size of large numbers, in bytes. The default is 1 MB, or about (BigInteger)0x7F << (8 * 1024 * 1024). An exception occurs if you try to serialize or deserialize a number larger than this.
This limit only applies to large-format numbers (i.e. those whose first byte is 0xFE).
When reading a large-format number, if the length prefix indicates that the number is larger than this, FormatException is thrown, even if there are so many leading zero bytes in the payload that the number doesn't "really" exceed the limit. In other words, even the number 0 will cause an exception if it is too large.
|
getset |
The ObjectMode used to read/write the root object. This option has no effect if you are using NewWriter or NewReader.
1.8.7