From fb3efbf499e5bb0952f09691222d5494c87167f1 Mon Sep 17 00:00:00 2001 From: skynetcap <100323448+skynetcap@users.noreply.github.com> Date: Fri, 8 Dec 2023 19:15:12 -0800 Subject: [PATCH] OBv2: Deserialize BookSide --- .../src/main/java/com/mmorrell/openbook/model/AnyNode.java | 4 ++-- .../main/java/com/mmorrell/openbook/model/OrderTreeNodes.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openbook/src/main/java/com/mmorrell/openbook/model/AnyNode.java b/openbook/src/main/java/com/mmorrell/openbook/model/AnyNode.java index 4d32738..ef70eb3 100644 --- a/openbook/src/main/java/com/mmorrell/openbook/model/AnyNode.java +++ b/openbook/src/main/java/com/mmorrell/openbook/model/AnyNode.java @@ -22,8 +22,8 @@ public static List readAnyNodes(byte[] data) { byte newTag = data[offset]; offset += 1; - byte[] newData = Arrays.copyOfRange(data, offset, offset + 7); - offset += 7; + byte[] newData = Arrays.copyOfRange(data, offset, offset + 87); + offset += 87; nodes.add( AnyNode.builder() diff --git a/openbook/src/main/java/com/mmorrell/openbook/model/OrderTreeNodes.java b/openbook/src/main/java/com/mmorrell/openbook/model/OrderTreeNodes.java index eed1805..374daec 100644 --- a/openbook/src/main/java/com/mmorrell/openbook/model/OrderTreeNodes.java +++ b/openbook/src/main/java/com/mmorrell/openbook/model/OrderTreeNodes.java @@ -30,7 +30,7 @@ public static OrderTreeNodes readOrderTreeNodes(byte[] data) { .freeListHead(OpenBookUtil.readInt32(data, 12)) .nodes( AnyNode.readAnyNodes( - Arrays.copyOfRange(data, 16, data.length) + Arrays.copyOfRange(data, 16 + 512, data.length) ) ) .build();