/** * Creates a {@code FileCacheSeekableStream} reading from the given * {@code InputStream}. Data will be cached in a temporary file, with * the given base name, in the given directory * * @param pStream the {@code InputStream} to read from * @param pTempBaseName optional base name for the temporary file * @param pTempDir optional temp directory * * @throws IOException if the temporary file cannot be created, * or cannot be opened for random access. */ public FileCacheSeekableStream(final InputStream pStream, final String pTempBaseName, final File pTempDir) throws IOException { // NOTE: We do validation BEFORE we create temp file, to avoid orphan files this(Validate.notNull(pStream, "stream"), createTempFile(pTempBaseName, pTempDir)); }
/** * Creates a {@code FileCacheSeekableStream} reading from the given * {@code InputStream}. Data will be cached in a temporary file, with * the given base name, in the given directory * * @param pStream the {@code InputStream} to read from * @param pTempBaseName optional base name for the temporary file * @param pTempDir optional temp directory * * @throws IOException if the temporary file cannot be created, * or cannot be opened for random access. */ public FileCacheSeekableStream(final InputStream pStream, final String pTempBaseName, final File pTempDir) throws IOException { // NOTE: We do validation BEFORE we create temp file, to avoid orphan files this(Validate.notNull(pStream, "stream"), createTempFile(pTempBaseName, pTempDir)); }
/** * Creates a {@code FileCacheSeekableStream} reading from the given * {@code InputStream}. Data will be cached in a temporary file, with * the given base name, in the given directory * * @param pStream the {@code InputStream} to read from * @param pTempBaseName optional base name for the temporary file * @param pTempDir optional temp directory * * @throws IOException if the temporary file cannot be created, * or cannot be opened for random access. */ public FileCacheSeekableStream(final InputStream pStream, final String pTempBaseName, final File pTempDir) throws IOException { // NOTE: We do validation BEFORE we create temp file, to avoid orphan files this(Validate.notNull(pStream, "stream"), createTempFile(pTempBaseName, pTempDir)); }