docs: public int getWeight() {
          if (!hasWitnesses())
              return getMessageSize() * 4;
          try (final ByteArrayOutputStream stream = new UnsafeByteArrayOutputStream(length)) {
              bitcoinSerializeToStream(stream, false);
              final int baseSize = stream.size();
              stream.reset();
              bitcoinSerializeToStream(stream, true);
              final int totalSize = stream.size();
              return baseSize * 3 + totalSize;
          } catch (IOException e) {
              throw new RuntimeException(e); // cannot happen
          }
      }