The Java SBE Sample Application is a reference implementation that demonstrates how to decode Binance API responses encoded using Simple Binary Encoding (SBE) in a JVM environment.
It reads an SBE-encoded payload from STDIN or fetches it directly from an API endpoint, and outputs a human-readable YAML representation to STDOUT. This makes it useful for inspecting, debugging, and validating SBE responses returned by Binance APIs.
For source code, updates, and examples, see the binance-sbe-java-sample-app repository on GitHub.
Supported environments
- Java 11 or newer
- Linux
- macOS
This is a sample application intended for local execution and inspection.
It is not a production-ready SDK.
What this sample demonstrates
This application focuses on decoding SBE-encoded API responses, not on sending or managing requests.
It demonstrates how to:
- Decode SBE-encoded API responses
- Convert binary SBE payloads into human-readable YAML
- Pipe SBE responses from REST or WebSocket APIs into a Java decoder
- Reuse generated SBE decoder classes in JVM-based projects
Typical use cases
- Inspecting and validating SBE responses
- Debugging integrations that use SBE
- Learning how Binance SBE schemas are decoded in Java
- Building internal tooling around SBE-based APIs
- Verifying authentication and request signing workflows with SBE output
Getting started
Clone the repository:
Code
Build the project using Maven:
Code
This produces the runnable JAR:
Code
Using the sample app
The application decodes SBE payloads and writes the decoded output to STDOUT.
Example: decoding an SBE REST response via STDIN
Code
Example: decoding an SBE WebSocket response
You can pipe WebSocket responses into the app using a helper script or tool that forwards raw WebSocket messages:
Code
To run websocket_send.py, your Python environment must include the websocket-client package.
Example: fetching and decoding within the app
The sample app can also fetch an SBE-encoded response directly:
Code
Authentication
When requesting SBE responses from authenticated endpoints, standard Binance authentication methods apply.
Examples in the repository demonstrate usage with:
HMAC-based authenticationRSA-based authenticationEd25519-based authentication
The sample application itself does not perform request signing—it only decodes SBE responses.
SBE decoders
The repository includes Java decoder classes generated from Binance SBE schemas using Simple Binary Encoding (SBE).
These decoders can be reused directly in your own Java or JVM-based projects, or adapted for custom SBE pipelines. If needed, the decoders can be regenerated from the latest schema files by following the instructions in the repository.
Notes and best practices
- This project is intended as a reference and debugging tool
- Always validate decoded fields against the official API documentation
- Prefer SBE only when binary efficiency or latency is required
- For general-purpose integrations, REST or WebSocket APIs may be simpler to use
- Use testnet environments when experimenting with authenticated endpoints