/** * Returns a copy of the array returned by {@link Message#unsafeBitcoinSerialize()}, which is safe to mutate. * If you need extra performance and can guarantee you won't write to the array, you can use the unsafe version. * * @return a freshly allocated serialized byte array */ public byte[] bitcoinSerialize() { byte[] bytes = unsafeBitcoinSerialize(); byte[] copy = new byte[bytes.length]; System.arraycopy(bytes, 0, copy, 0, bytes.length); return copy; }
/** * Returns a copy of the array returned by {@link Message#unsafeBitcoinSerialize()}, which is safe to mutate. * If you need extra performance and can guarantee you won't write to the array, you can use the unsafe version. * * @return a freshly allocated serialized byte array */ public byte[] bitcoinSerialize() { byte[] bytes = unsafeBitcoinSerialize(); byte[] copy = new byte[bytes.length]; System.arraycopy(bytes, 0, copy, 0, bytes.length); return copy; }
/** * Returns a copy of the array returned by {@link Message#unsafeBitcoinSerialize()}, which is safe to mutate. * If you need extra performance and can guarantee you won't write to the array, you can use the unsafe version. * * @return a freshly allocated serialized byte array */ public byte[] bitcoinSerialize() { byte[] bytes = unsafeBitcoinSerialize(); byte[] copy = new byte[bytes.length]; System.arraycopy(bytes, 0, copy, 0, bytes.length); return copy; }
/** * Returns a copy of the array returned by {@link Message#unsafeBitcoinSerialize()}, which is safe to mutate. * If you need extra performance and can guarantee you won't write to the array, you can use the unsafe version. * * @return a freshly allocated serialized byte array */ public byte[] bitcoinSerialize() { byte[] bytes = unsafeBitcoinSerialize(); byte[] copy = new byte[bytes.length]; System.arraycopy(bytes, 0, copy, 0, bytes.length); return copy; }