@Override public void encode(final IAMCodec codec, final IAMIndex index) throws IOException, IllegalArgumentException { try { try (OutputStream stream = IO.outputStreamFrom(codec.getTargetData())) { stream.write(index.toBytes(codec.getByteOrder().toOrder())); } } catch (IOException | IllegalArgumentException cause) { throw cause; } catch (final Exception cause) { throw new IllegalArgumentException(cause); } }