/** * Serializes the given {@code TransactionEdit} instance with the latest available codec. * This will first write out the version of the codec used to serialize the instance so that * the correct codec can be used when calling {@link #decode(TransactionEdit, DataInput)}. * * @param src the transaction edit to serialize * @param out the output stream to contain the data * @throws IOException if an error occurs while serializing to the output stream */ public static void encode(TransactionEdit src, DataOutput out) throws IOException { TransactionEditCodec latestCodec = CODECS.get(CODECS.firstKey()); out.writeByte(latestCodec.getVersion()); latestCodec.encode(src, out); }
/** * Serializes the given {@code TransactionEdit} instance with the latest available codec. * This will first write out the version of the codec used to serialize the instance so that * the correct codec can be used when calling {@link #decode(TransactionEdit, DataInput)}. * * @param src the transaction edit to serialize * @param out the output stream to contain the data * @throws IOException if an error occurs while serializing to the output stream */ public static void encode(TransactionEdit src, DataOutput out) throws IOException { TransactionEditCodec latestCodec = CODECS.get(CODECS.firstKey()); out.writeByte(latestCodec.getVersion()); latestCodec.encode(src, out); }
/** * Serializes the given {@code TransactionEdit} instance with the latest available codec. * This will first write out the version of the codec used to serialize the instance so that * the correct codec can be used when calling {@link #decode(TransactionEdit, DataInput)}. * * @param src the transaction edit to serialize * @param out the output stream to contain the data * @throws IOException if an error occurs while serializing to the output stream */ public static void encode(TransactionEdit src, DataOutput out) throws IOException { TransactionEditCodec latestCodec = CODECS.get(CODECS.firstKey()); out.writeByte(latestCodec.getVersion()); latestCodec.encode(src, out); }
/** * Encodes the given transaction edit using a specific codec. Note that this is only exposed * for use by tests. */ @VisibleForTesting static void encode(TransactionEdit src, DataOutput out, TransactionEditCodec codec) throws IOException { out.writeByte(codec.getVersion()); codec.encode(src, out); }
/** * Encodes the given transaction edit using a specific codec. Note that this is only exposed * for use by tests. */ @VisibleForTesting static void encode(TransactionEdit src, DataOutput out, TransactionEditCodec codec) throws IOException { out.writeByte(codec.getVersion()); codec.encode(src, out); }
/** * Encodes the given transaction edit using a specific codec. Note that this is only exposed * for use by tests. */ @VisibleForTesting static void encode(TransactionEdit src, DataOutput out, TransactionEditCodec codec) throws IOException { out.writeByte(codec.getVersion()); codec.encode(src, out); }