算术编码 二进制编码_5个简单的二进制编码陷阱

算术编码 二进制编码

Spending hours in frustration debugging Simple Binary Encoding (SBE) issues in your application? You aren’t alone. I’ve been there before. This post hopes to alleviate some of your pains by covering up to 80% of common usage issues related to SBE (I believe).

在挫败性调试上花费数小时来解决应用程序中的简单二进制编码(SBE)问题? 你并不孤单。 我去过那里这篇文章希望通过覆盖多达80%的与SBE相关的常见用法问题来减轻您的痛苦(我相信)。

Code examples: https://github.com/tommyqqt/sbe-gotchas.git

代码示例: https : //github.com/tommyqqt/sbe-gotchas.git

Let’s recap:

让我们回顾一下:

SBE is an ultra-fast codec commonly used in low latency financial applications such as FIX engines, pricing engines, etc. This post assumes that you are familiar with the basics.

SBE是一种超快速编解码器,通常用于FIX引擎,定价引擎等低延迟金融应用程序中。本文假定您熟悉基础知识。

If you are new to SBE, visit https://github.com/real-logic/simple-binary-encoding

如果您不熟悉SBE,请访问https://github.com/real-logic/simple-binary-encoding

This post refers to the specific SBE implementation in Java (version 1.19.0) developed by Real-Logic. It is not about the SBE FIX standard.

这篇文章引用了Real-Logic开发的Java(1.19.0版)中的特定SBE实现。 它与SBE FIX标准无关。

The same structure Block Fields-Repeating Groups-Var length fields can also be nested in each repeating group.

相同的结构块字段-重复组-长度字段也可以嵌套在每个重复组中。

Fields in an SBE message have to be encoded/decoded sequentially unless the limit is at the beginning of a block whose fixed length members can be accessed randomly.

除非限制在固定长度成员可以随机访问的块的开头,否则SBE消息中的字段必须按顺序进行编码/解码。

Now let’s jump to the common gotchas!

现在,让我们跳到常见的陷阱!

1.当编码长度不是编码长度时 (1. When encoded length isn’t encoded length)

There are times when we would want to know the encoded length of an SBE message, such as sending the message over the wire or persisting it to a file.

有时候,我们想知道SBE消息的编码长度,例如通过线路发送消息或将其持久保存到文件中。

How would you get the encoded length of an SBE message? If we just finished encoding the message and we have the encoder on hand, isn’t it just simply calling encoder.encodedLength()? Let’s try it out.

您将如何获得SBE消息的编码长度? 如果我们刚刚完成了对消息的编码,并且手头有了编码器,那不是只是简单地调用encoder.encodedLength()吗? 让我们尝试一下。

final
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值