* @throws PDFSecurityException if a security provider cannot be found
     *                              or there is an error decrypting the file.
     * @throws IOException          if a problem setting up, or parsing the file.
     */
    public void setFile(String filepath)
            throws PDFException, PDFSecurityException, IOException {
        setDocumentOrigin(filepath);
        RandomAccessFileInputStream rafis =
                RandomAccessFileInputStream.build(new File(filepath));

        /*
        // Test code for setByteArray(-)
        if( true ) {
            byte[] buffer = new byte[4096];
            int read = buffer.length;
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream( 40960 );
            while ((read = rafis.read(buffer, 0, buffer.length)) > 0){
                byteArrayOutputStream.write(buffer, 0, read);
            }
            byteArrayOutputStream.flush();
            byteArrayOutputStream.close();
            rafis.close();
            int length = byteArrayOutputStream.size();
            byte[] data = byteArrayOutputStream.toByteArray();
            setByteArray( data, 0, length, null );
            return;
        }
        */

        setInputStream(rafis);
    }