Package com.itextpdf.text.io

Examples of com.itextpdf.text.io.RandomAccessSource


     */
    private static PRTokeniser getOffsetTokeniser(RandomAccessSource byteSource) throws IOException{
      PRTokeniser tok = new PRTokeniser(new RandomAccessFileOrArray(byteSource));
      int offset = tok.getHeaderOffset();
      if (offset != 0){
        RandomAccessSource offsetSource = new WindowRandomAccessSource(byteSource, offset);
        tok = new PRTokeniser(new RandomAccessFileOrArray(offsetSource));
      }
      return tok;
    }
View Full Code Here


            throw new DocumentException("Not the last signature");
        PdfArray b = v.getAsArray(PdfName.BYTERANGE);
        long[] gaps = b.asLongArray();
        if (b.size() != 4 || gaps[0] != 0)
            throw new DocumentException("Single exclusion space supported");
        RandomAccessSource readerSource = reader.getSafeFile().createSourceView();
        InputStream rg = new RASInputStream(new RandomAccessSourceFactory().createRanged(readerSource, gaps));
        byte[] signedContent = externalSignatureContainer.sign(rg);
        int spaceAvailable = (int)(gaps[2] - gaps[1]) - 2;
        if ((spaceAvailable & 1) != 0)
            throw new DocumentException("Gap is not a multiple of 2");
View Full Code Here

TOP

Related Classes of com.itextpdf.text.io.RandomAccessSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.