org.sejda.model.input
Class PdfStreamSource

java.lang.Object
  extended by org.sejda.model.input.AbstractPdfSource<InputStream>
      extended by org.sejda.model.input.PdfStreamSource
All Implemented Interfaces:
PdfSource<InputStream>

public final class PdfStreamSource
extends AbstractPdfSource<InputStream>

AbstractPdfSource from a InputStream

Author:
Andrea Vacondio

Method Summary
 InputStream getSource()
           
static PdfStreamSource newInstanceNoPassword(InputStream stream, String name)
          Creates a new instance of the pdf source where a password is NOT required to open the source.
static PdfStreamSource newInstanceWithPassword(InputStream stream, String name, String password)
          Creates a new instance of the pdf source where a password is required to open the source.
<T> T
open(PdfSourceOpener<T> opener)
          Dispatch method to open the source.
 
Methods inherited from class org.sejda.model.input.AbstractPdfSource
getName, getPassword, getPasswordBytes, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSource

public InputStream getSource()
Returns:
the source

open

public <T> T open(PdfSourceOpener<T> opener)
       throws TaskIOException
Description copied from interface: PdfSource
Dispatch method to open the source.

Type Parameters:
T - generic type as result of the open action.
Returns:
result of the open action as a type defined by the dispatcher.
Throws:
TaskIOException - in case of error opening the source.

newInstanceNoPassword

public static PdfStreamSource newInstanceNoPassword(InputStream stream,
                                                    String name)
Creates a new instance of the pdf source where a password is NOT required to open the source.

Parameters:
stream - input pdf stream
name -
Returns:
a newly created instance

newInstanceWithPassword

public static PdfStreamSource newInstanceWithPassword(InputStream stream,
                                                      String name,
                                                      String password)
Creates a new instance of the pdf source where a password is required to open the source.

Parameters:
stream - input pdf stream
name -
password -
Returns:
a newly created instance
Throws:
IllegalArgumentException - if the input stream or the input name are blank.


Copyright © 2013 sejda. All Rights Reserved.