Home » pdfbox-1.1.0-src » org.apache.pdfbox.pdmodel.common » [javadoc | source]
org.apache.pdfbox.pdmodel.common
public class: PDTextStream [javadoc | source]
java.lang.Object
   org.apache.pdfbox.pdmodel.common.PDTextStream

All Implemented Interfaces:
    COSObjectable

A PDTextStream class is used when the PDF specification supports either a string or a stream for the value of an object. This is usually when a value could be large or small, for example a JavaScript method. This class will help abstract that and give a single unified interface to those types of fields.
Constructor:
 public PDTextStream(COSString str) 
    Constructor.
    Parameters:
    str - The string parameter.
 public PDTextStream(String str) 
    Constructor.
    Parameters:
    str - The string parameter.
 public PDTextStream(COSStream str) 
    Constructor.
    Parameters:
    str - The stream parameter.
Method from org.apache.pdfbox.pdmodel.common.PDTextStream Summary:
createTextStream,   getAsStream,   getAsString,   getCOSObject
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.pdfbox.pdmodel.common.PDTextStream Detail:
 public static PDTextStream createTextStream(COSBase base) 
    This will create the text stream object. base must either be a string or a stream.
 public InputStream getAsStream() throws IOException 
    This is the preferred way of getting data with this class as it uses a stream object.
 public String getAsString() throws IOException 
    This will get this value as a string. If this is a stream then it will load the entire stream into memory, so you should only do this when the stream is a manageable size.
 public COSBase getCOSObject() 
    Convert this standard java object to a COS object.