KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > etymon > pjx > PdfInput


1 /*
2   Copyright (C) Etymon Systems, Inc. <http://www.etymon.com/>
3 */

4
5 package com.etymon.pjx;
6
7 import java.io.*;
8 import java.nio.*;
9
10 /**
11    Specifies methods used by {@link PdfReader PdfReader} to read
12    portions of a PDF document. A class that implements this interface
13    should represent one PDF document per instance of the class.
14    @author Nassib Nassar
15  */

16 public interface PdfInput {
17
18     /**
19        Returns a name string associated of the PDF document.
20        @return the name of the PDF document.
21      */

22     public String JavaDoc getName();
23     
24     /**
25        Returns the length of the PDF document.
26        @return the length (in bytes) of the PDF document.
27      */

28     public long getLength();
29     
30     /**
31        Returns a specified portion of a PDF document as a
32        <code>ByteBuffer</code>.
33        @param start the offset position of the first byte to read.
34        @param end the offset position at which to stop reading.
35        (The byte at this offset is not included.)
36        @return the requested portion of the PDF document.
37        @throws IOException
38     */

39     public ByteBuffer readBytes(long start, long end) throws IOException;
40
41     /**
42        Returns a specified portion of a PDF document as a
43        <code>CharBuffer</code>.
44        @param start the offset position of the first byte to read.
45        @param end the offset position at which to stop reading.
46        (The byte at this offset is not included.)
47        @return the requested portion of the PDF document.
48        @throws IOException
49     */

50     public CharBuffer readChars(long start, long end) throws IOException;
51
52 }
53
Popular Tags