Skip to content

Commit a0a1eda

Browse files
dfa1claude
andcommitted
docs: drop custom encoding section from how-to
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8a8ddce commit a0a1eda

1 file changed

Lines changed: 0 additions & 46 deletions

File tree

docs/how-to.md

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -226,49 +226,3 @@ try (VortexReader vf = VortexReader.open(Path.of("future.vortex"), registry);
226226
}
227227
}
228228
```
229-
230-
---
231-
232-
## Add a custom encoding
233-
234-
Three touch-points required:
235-
236-
**1. Register the encoding ID** in `EncodingId.java`:
237-
238-
```java
239-
MY_ENCODING("com.example.my_encoding"),
240-
```
241-
242-
**2. Implement `Encoding`:**
243-
244-
```java
245-
public final class MyEncoding implements Encoding {
246-
247-
@Override
248-
public EncodingId id() { return EncodingId.MY_ENCODING; }
249-
250-
@Override
251-
public EncodeResult encode(DType dtype, Object data) { return Encoder.encode(dtype, data); }
252-
253-
@Override
254-
public Array decode(DecodeContext ctx) { return Decoder.decode(ctx); }
255-
256-
private static final class Encoder { /* ... */ }
257-
private static final class Decoder { /* ... */ }
258-
}
259-
```
260-
261-
**3. Register via `ServiceLoader`** — add the fully-qualified class name to:
262-
263-
```
264-
META-INF/services/io.github.dfa1.vortex.encoding.Encoding
265-
```
266-
267-
The encoding is then picked up automatically by `EncodingRegistry.loadAll()`.
268-
To register it only for a specific reader without touching the global registry:
269-
270-
```java
271-
EncodingRegistry registry = EncodingRegistry.loadAll();
272-
registry.register(new MyEncoding());
273-
VortexReader vf = VortexReader.open(path, registry);
274-
```

0 commit comments

Comments
 (0)