Open
Conversation
Signed-off-by: Leclerc Clement <clement.leclerc@rte-france.com>
…n XML, JSON, and binary serialization Signed-off-by: Leclerc Clement <clement.leclerc@rte-france.com>
Signed-off-by: Leclerc Clement <clement.leclerc@rte-france.com>
…ort for skipping extensions Signed-off-by: Leclerc Clement <clement.leclerc@rte-france.com>
Signed-off-by: Leclerc Clement <clement.leclerc@rte-france.com>
Signed-off-by: Leclerc Clement <clement.leclerc@rte-france.com>
flo-dup
reviewed
Mar 16, 2026
| private String[] attrNames; | ||
| private byte[] attrTypes; | ||
|
|
||
| private Map<String, Object> currentAttrs = Collections.emptyMap(); |
Collaborator
There was a problem hiding this comment.
Don't buffer attributes, just read them on the fly
…ted unit tests Signed-off-by: Leclerc Clement <clement.leclerc@rte-france.com>
… cl-binary-named-attributes
8 tasks
|
Comment on lines
+115
to
+119
| if (index > 255) { | ||
| throw new PowsyblException("Binary format: too many distinct attribute (name, type) pairs (max 255)"); | ||
| } | ||
| try { | ||
| attrDos.writeByte(index); |
Contributor
There was a problem hiding this comment.
you are checking that the index is not more than 255, but in java Byte is signed, shouldn't it be 127 instead ? How about using Byte.MAX_VALUE instead ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
Feature — redesign of the binary IIDM serialization format (BinReader / BinWriter).
What is the current behavior?
The binary format uses a positional (sequential) attribute encoding: attributes are written in a fixed order and read back in the same order. The name parameter passed to read*Attribute("name") is
completely ignored — the reader blindly consumes bytes from the stream. As a result:
What is the new behavior (if this is a feature change)?
Attributes are now named: a global dictionary maps attribute names to compact 1-byte indices. Each attribute occurrence in the body is encoded as [byte: index][byte: type][value]. Before a node's children are processed, all its attributes are pre-read into a Map<String, Object> keyed by name.
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
The binary file format is not backward compatible. Binary files produced before this PR cannot be read by the new code, and vice versa. Since the binary format was already marked as BETA with no stability guarantee across releases, no migration path is provided. Users should re-export any existing .biidm files using the new version.
Other information: