/** * * @param params NetworkParameters object. * @param payload Bitcoin protocol formatted byte array containing message content. * @param offset The location of the first payload byte within the array. * @param protocolVersion Bitcoin protocol version. * @param serializer the serializer to use for this message. * @param length The length of message payload if known. Usually this is provided when deserializing of the wire * as the length will be provided as part of the header. If unknown then set to Message.UNKNOWN_LENGTH * @throws ProtocolException */ protected Message(NetworkParameters params, byte[] payload, int offset, int protocolVersion, MessageSerializer serializer, int length) throws ProtocolException { this.serializer = serializer; this.protocolVersion = protocolVersion; this.params = params; this.payload = payload; this.cursor = this.offset = offset; this.length = length; parse(); if (this.length == UNKNOWN_LENGTH) checkState(false, "Length field has not been set in constructor for %s after parse.", getClass().getSimpleName()); if (SELF_CHECK) { selfCheck(payload, offset); } if (!serializer.isParseRetainMode()) this.payload = null; }
/** * * @param params NetworkParameters object. * @param payload Bitcoin protocol formatted byte array containing message content. * @param offset The location of the first payload byte within the array. * @param protocolVersion Bitcoin protocol version. * @param serializer the serializer to use for this message. * @param length The length of message payload if known. Usually this is provided when deserializing of the wire * as the length will be provided as part of the header. If unknown then set to Message.UNKNOWN_LENGTH * @throws ProtocolException */ protected Message(NetworkParameters params, byte[] payload, int offset, int protocolVersion, MessageSerializer serializer, int length) throws ProtocolException { this.serializer = serializer; this.protocolVersion = protocolVersion; this.params = params; this.payload = payload; this.cursor = this.offset = offset; this.length = length; parse(); if (this.length == UNKNOWN_LENGTH) checkState(false, "Length field has not been set in constructor for %s after parse.", getClass().getSimpleName()); if (SELF_CHECK) { selfCheck(payload, offset); } if (!serializer.isParseRetainMode()) this.payload = null; }
/** * * @param params NetworkParameters object. * @param payload Bitcoin protocol formatted byte array containing message content. * @param offset The location of the first payload byte within the array. * @param protocolVersion Bitcoin protocol version. * @param serializer the serializer to use for this message. * @param length The length of message payload if known. Usually this is provided when deserializing of the wire * as the length will be provided as part of the header. If unknown then set to Message.UNKNOWN_LENGTH * @throws ProtocolException */ protected Message(NetworkParameters params, byte[] payload, int offset, int protocolVersion, MessageSerializer serializer, int length) throws ProtocolException { this.serializer = serializer; this.protocolVersion = protocolVersion; this.params = params; this.payload = payload; this.cursor = this.offset = offset; this.length = length; parse(); if (this.length == UNKNOWN_LENGTH) checkState(false, "Length field has not been set in constructor for %s after parse.", getClass().getSimpleName()); if (SELF_CHECK) { selfCheck(payload, offset); } if (!serializer.isParseRetainMode()) this.payload = null; }
/** * * @param params NetworkParameters object. * @param payload Bitcoin protocol formatted byte array containing message content. * @param offset The location of the first payload byte within the array. * @param protocolVersion Bitcoin protocol version. * @param serializer the serializer to use for this message. * @param length The length of message payload if known. Usually this is provided when deserializing of the wire * as the length will be provided as part of the header. If unknown then set to Message.UNKNOWN_LENGTH * @throws ProtocolException */ protected Message(NetworkParameters params, byte[] payload, int offset, int protocolVersion, MessageSerializer serializer, int length) throws ProtocolException { this.serializer = serializer; this.protocolVersion = protocolVersion; this.params = params; this.payload = payload; this.cursor = this.offset = offset; this.length = length; parse(); if (this.length == UNKNOWN_LENGTH) checkState(false, "Length field has not been set in constructor for %s after parse.", getClass().getSimpleName()); if (SELF_CHECK) { selfCheck(payload, offset); } if (!serializer.isParseRetainMode()) this.payload = null; }