public static byte[] varBytes(InputStream in) throws IOException { return varBytes(in, null); }
public static Plaintext read(Type type, InputStream in) throws IOException { return readWithoutSignature(type, in) .signature(Decode.varBytes(in)) .build(); }
public static Plaintext read(Type type, InputStream in) throws IOException { return readWithoutSignature(type, in) .signature(Decode.varBytes(in)) .received(UnixTime.now()) .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 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); }
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 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(); }