All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yoti.api.client.InputStreamKeyPairSource Maven / Gradle / Ivy

The newest version!
package com.yoti.api.client;

import java.io.InputStream;

/**
 * Responsible for getting key pairs from am existing InputStream instance.
 * Streams will not be closed upon completion.
 *
 */
public class InputStreamKeyPairSource extends AutoClosingKeyPairSource {
    private final InputStream stream;

    public static InputStreamKeyPairSource fromStream(InputStream inputStream) {
        return new InputStreamKeyPairSource(inputStream);
    }

    private InputStreamKeyPairSource(InputStream inputStream) {
        stream = inputStream;
    }

    @Override
    protected InputStream getStream() {
        return stream;
    }

    @Override
    protected boolean shouldClose() {
        // Do not close stream as it's an external one.
        return false;
    }

    @Override
    public String toString() {
        return "a stream";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy