public static int int32(InputStream stream) throws IOException { return int32(stream, null); }
public static int int32(InputStream in) throws IOException { return int32(in, null); }
public static V3Pubkey read(InputStream is, long stream) throws IOException { return new V3Pubkey.Builder() .stream(stream) .behaviorBitfield(Decode.int32(is)) .publicSigningKey(Decode.bytes(is, 64)) .publicEncryptionKey(Decode.bytes(is, 64)) .nonceTrialsPerByte(Decode.varInt(is)) .extraBytes(Decode.varInt(is)) .signature(Decode.varBytes(is)) .build(); }
public static Plaintext.Builder readWithoutSignature(Type type, InputStream in) throws IOException { long version = Decode.varInt(in); return new Builder(type) .addressVersion(version) .stream(Decode.varInt(in)) .behaviorBitfield(Decode.int32(in)) .publicSigningKey(Decode.bytes(in, 64)) .publicEncryptionKey(Decode.bytes(in, 64)) .nonceTrialsPerByte(version >= 3 ? Decode.varInt(in) : 0) .extraBytes(version >= 3 ? Decode.varInt(in) : 0) .destinationRipe(type == Type.MSG ? Decode.bytes(in, 20) : null) .encoding(Decode.varInt(in)) .message(Decode.varBytes(in)) .ack(type == Type.MSG ? Decode.varBytes(in) : null); }
public static V3Pubkey read(InputStream is, long stream) throws IOException { return new V3Pubkey.Builder() .stream(stream) .behaviorBitfield(Decode.int32(is)) .publicSigningKey(Decode.bytes(is, 64)) .publicEncryptionKey(Decode.bytes(is, 64)) .nonceTrialsPerByte(Decode.varInt(is)) .extraBytes(Decode.varInt(is)) .signature(Decode.varBytes(is)) .build(); }
public static Plaintext.Builder readWithoutSignature(Type type, InputStream in) throws IOException { long version = Decode.varInt(in); return new Builder(type) .addressVersion(version) .stream(Decode.varInt(in)) .behaviorBitfield(Decode.int32(in)) .publicSigningKey(Decode.bytes(in, 64)) .publicEncryptionKey(Decode.bytes(in, 64)) .nonceTrialsPerByte(version >= 3 ? Decode.varInt(in) : 0) .extraBytes(version >= 3 ? Decode.varInt(in) : 0) .destinationRipe(type == Type.MSG ? Decode.bytes(in, 20) : null) .encoding(Decode.varInt(in)) .message(Decode.varBytes(in)) .ackMessage(type == Type.MSG ? Decode.varBytes(in) : null); }
private static Version parseVersion(InputStream stream) throws IOException { int version = Decode.int32(stream); long services = Decode.int64(stream); long timestamp = Decode.int64(stream); NetworkAddress addrRecv = parseAddress(stream, true); NetworkAddress addrFrom = parseAddress(stream, true); long nonce = Decode.int64(stream); String userAgent = Decode.varString(stream); long[] streamNumbers = Decode.varIntList(stream); return new Version.Builder() .version(version) .services(services) .timestamp(timestamp) .addrRecv(addrRecv).addrFrom(addrFrom) .nonce(nonce) .userAgent(userAgent) .streams(streamNumbers).build(); }
private static Version parseVersion(InputStream stream) throws IOException { int version = Decode.int32(stream); long services = Decode.int64(stream); long timestamp = Decode.int64(stream); NetworkAddress addrRecv = parseAddress(stream, true); NetworkAddress addrFrom = parseAddress(stream, true); long nonce = Decode.int64(stream); String userAgent = Decode.varString(stream); long[] streamNumbers = Decode.varIntList(stream); return new Version.Builder() .version(version) .services(services) .timestamp(timestamp) .addrRecv(addrRecv).addrFrom(addrFrom) .nonce(nonce) .userAgent(userAgent) .streams(streamNumbers).build(); }