if (minor == 0) {
throw new NotImplemented("encoding with minor_version=0");
}
EOutputStream eos = new EOutputStream();
eos.write(EExternal.versionTag);
if (compression != 0) {
eos.write_compressed(obj, compression);
} else {
eos.write_any(obj);
}
return eos.getBinaryContent();
}