@Override
OutputStream encode(final OutputStream out, final Object options) throws IOException {
int distance = numberOptionOrDefault(options, 1);
try {
return new DeltaOptions(distance).getOutputStream(new FinishableWrapperOutputStream(out));
} catch (UnsupportedOptionsException ex) {
throw new IOException(ex.getMessage());
}
}