Skip to content

Commit

Permalink
#77 Fixed offset calculation for deleted records (#78)
Browse files Browse the repository at this point in the history
Actually `vars.get(0)` is array of 4 bytes (its length is based on a SasFileConstants.PAGE_DELETED_POINTER_LENGTH = 4). So, it is more correct to use bytesToInt() conversion here instead of bytesToShort().
  • Loading branch information
xantorohara authored Dec 16, 2020
1 parent f8c27f6 commit f960f86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/epam/parso/impl/SasFileParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ private void readDeletedInfo() throws IOException {
List<byte[]> vars = getBytesFromFile(new Long[] {deletedPointerOffset},
new Integer[] {PAGE_DELETED_POINTER_LENGTH});

long currentPageDeletedPointer = bytesToShort(vars.get(0));
long currentPageDeletedPointer = bytesToInt(vars.get(0));
long deletedMapOffset = bitOffset + currentPageDeletedPointer + alignCorrection
+ (currentPageSubheadersCount * subheaderPointerLength)
+ ((currentPageBlockCount - currentPageSubheadersCount) * sasFileProperties.getRowLength());
Expand Down

0 comments on commit f960f86

Please sign in to comment.