Skip to content

Commit

Permalink
Fixes the serialisation problem appearing in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed Feb 22, 2024
1 parent ddc29a5 commit e77fe58
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public static Object createFromBytes(final IScope scope, final byte[] bytes) {
byte type = bytes[0];
if (type != GAMA_OBJECT_IDENTIFIER && type != GAMA_AGENT_IDENTIFIER)
throw GamaRuntimeException.error("Not a GAMA serialisation record", scope);
boolean zip = bytes[2] == COMPRESSED;
byte[] some = Arrays.copyOfRange(bytes, 3, bytes.length);
boolean zip = bytes[1] == COMPRESSED;
byte[] some = Arrays.copyOfRange(bytes, 2, bytes.length);
if (zip) { some = ByteArrayZipper.unzip(some); }
return type == GAMA_OBJECT_IDENTIFIER ? PROCESSOR.createObjectFromBytes(scope, some)
: PROCESSOR.createAgentFromBytes(scope, some);
Expand Down

0 comments on commit e77fe58

Please sign in to comment.