Replaced logPageLength with byteLength to prevent buffer shrink bug