JPedal Java PDF library 4.01b28 API Documentation - http://www.jpedal.org

org.jpedal.io
Class ObjectStore

java.lang.Object
  extended by org.jpedal.io.ObjectStore

public class ObjectStore
extends java.lang.Object

set of methods to save/load objects to keep memory usage to a minimum by spooling images to disk Also includes ancillary method to store a filename - LogWriter is my logging class - Several methods are very similar and I should recode my code to use a common method for the RGB conversion Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php -


Field Summary
 java.lang.String fullFileName
          Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
static java.lang.Integer IMAGE_HEIGHT
          parameter stored on cached images
static java.lang.Integer IMAGE_pX
          parameter stored on cached images
static java.lang.Integer IMAGE_pY
          parameter stored on cached images
static java.lang.Integer IMAGE_WIDTH
          parameter stored on cached images
static boolean isMultiThreaded
          do not set unless you know what you are doing
static java.lang.String temp_dir
          temp storage for the images so they are not held in memory
static long time
          period after which we assumes files must be dead (ie from crashed instance) default is four hour image time
 
Constructor Summary
ObjectStore()
          ObjectStore - Converted for Threading purposes - To fix any errors please try replacing ObjectStore with {your instance of PdfDecoder}.getObjectStore() - Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 
Method Summary
static void cachePage(java.lang.Integer key, org.jpedal.render.DynamicVectorRenderer currentDisplay)
           
static void cachePageAsBytes(java.lang.String key, byte[] bytes)
           
static void copy(java.io.BufferedInputStream from, java.io.BufferedOutputStream to)
           
static void copy(java.lang.String source, java.lang.String destination)
          save copy Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/
 void copyCMYKimages(java.lang.String target_dir)
          copies cmyk raw data from cmyk temp dir to target directory Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 void finalize()
           
 void flush()
          routine to remove all objects from temp store Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
static void flushPages()
          delete all cached pages
static org.jpedal.render.DynamicVectorRenderer getCachedPage(java.lang.Integer key)
          note may not actually be written by JVM immediately so do not rely for fast actions
static byte[] getCachedPageAsBytes(java.lang.String key)
           
 java.lang.String getCurrentFilename()
          get the file name - we use this as a get in our file repository - Note this method is not part of the API and is not guaranteed to be in future versions of JPedal - Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 java.lang.String getFileForCachedImage(java.lang.String current_image)
           
 java.lang.String getImageType(java.lang.String current_image)
          get type of image used to store graphic Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 byte[] getRawImageData(java.lang.String i)
          retrieve byte data on disk
 java.lang.Object getRawImageDataParameter(java.lang.String imageID, java.lang.Integer key)
          return parameter stored for image or null
 void init(java.lang.String current_key)
          init method to pass in values for temp directory, unique key, etc so program knows where to store files Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 boolean isImageCached(java.lang.String current_image)
          see if image already saved to disk (ie multiple pages)
 boolean isRawImageDataSaved(java.lang.String number)
          see if image data saved
 java.awt.image.BufferedImage loadStoredImage(java.lang.String current_image)
          load a image when required and remove from store Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 void saveAsCopy(java.lang.String current_image, java.lang.String destination)
          save copy Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 boolean saveRawCMYKImage(byte[] image_data, java.lang.String name)
          save raw CMYK data in CMYK directory - We extract the DCT encoded image stream and save as a file with a .jpeg ending so we have the raw image - This works for DeviceCMYK - Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 void saveRawImageData(java.lang.String pageImgCount, byte[] bytes, int w, int h, int pX, int pY)
           
 boolean saveStoredImage(java.lang.String current_image, java.awt.image.BufferedImage image, boolean file_name_is_path, boolean save_unclipped, java.lang.String type)
          save buffered image as JPEG or tif Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 void storeFileName(java.lang.String name)
          store filename as a key we can use to differentiate images,etc - Note this method is not part of the API and is not guaranteed to be in future versions of JPedal - Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isMultiThreaded

public static boolean isMultiThreaded
do not set unless you know what you are doing


temp_dir

public static java.lang.String temp_dir
temp storage for the images so they are not held in memory


IMAGE_WIDTH

public static final java.lang.Integer IMAGE_WIDTH
parameter stored on cached images


IMAGE_HEIGHT

public static final java.lang.Integer IMAGE_HEIGHT
parameter stored on cached images


IMAGE_pX

public static final java.lang.Integer IMAGE_pX
parameter stored on cached images


IMAGE_pY

public static final java.lang.Integer IMAGE_pY
parameter stored on cached images


time

public static long time
period after which we assumes files must be dead (ie from crashed instance) default is four hour image time


fullFileName

public java.lang.String fullFileName
Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php

Constructor Detail

ObjectStore

public ObjectStore()
ObjectStore - Converted for Threading purposes - To fix any errors please try replacing ObjectStore with {your instance of PdfDecoder}.getObjectStore() - Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php

Method Detail

getCurrentFilename

public java.lang.String getCurrentFilename()
get the file name - we use this as a get in our file repository - Note this method is not part of the API and is not guaranteed to be in future versions of JPedal - Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


storeFileName

public final void storeFileName(java.lang.String name)
store filename as a key we can use to differentiate images,etc - Note this method is not part of the API and is not guaranteed to be in future versions of JPedal - Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


saveRawCMYKImage

public boolean saveRawCMYKImage(byte[] image_data,
                                java.lang.String name)
save raw CMYK data in CMYK directory - We extract the DCT encoded image stream and save as a file with a .jpeg ending so we have the raw image - This works for DeviceCMYK - Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


saveStoredImage

public final boolean saveStoredImage(java.lang.String current_image,
                                     java.awt.image.BufferedImage image,
                                     boolean file_name_is_path,
                                     boolean save_unclipped,
                                     java.lang.String type)
save buffered image as JPEG or tif Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


getImageType

public final java.lang.String getImageType(java.lang.String current_image)
get type of image used to store graphic Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


init

public final void init(java.lang.String current_key)
init method to pass in values for temp directory, unique key, etc so program knows where to store files Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


loadStoredImage

public final java.awt.image.BufferedImage loadStoredImage(java.lang.String current_image)
load a image when required and remove from store Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


isImageCached

public final boolean isImageCached(java.lang.String current_image)
see if image already saved to disk (ie multiple pages)


flush

public final void flush()
routine to remove all objects from temp store Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


copyCMYKimages

public void copyCMYKimages(java.lang.String target_dir)
copies cmyk raw data from cmyk temp dir to target directory Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


getFileForCachedImage

public java.lang.String getFileForCachedImage(java.lang.String current_image)

saveAsCopy

public final void saveAsCopy(java.lang.String current_image,
                             java.lang.String destination)
save copy Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/phpBB2/index.php


copy

public static final void copy(java.lang.String source,
                              java.lang.String destination)
save copy Converted to avoid threading issues, if this causes any problems, please raise them in our forums, http://www.jpedal.org/


copy

public static void copy(java.io.BufferedInputStream from,
                        java.io.BufferedOutputStream to)

flushPages

public static void flushPages()
delete all cached pages


finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

getCachedPage

public static org.jpedal.render.DynamicVectorRenderer getCachedPage(java.lang.Integer key)
note may not actually be written by JVM immediately so do not rely for fast actions


cachePage

public static void cachePage(java.lang.Integer key,
                             org.jpedal.render.DynamicVectorRenderer currentDisplay)

getCachedPageAsBytes

public static byte[] getCachedPageAsBytes(java.lang.String key)

cachePageAsBytes

public static void cachePageAsBytes(java.lang.String key,
                                    byte[] bytes)

saveRawImageData

public void saveRawImageData(java.lang.String pageImgCount,
                             byte[] bytes,
                             int w,
                             int h,
                             int pX,
                             int pY)

isRawImageDataSaved

public boolean isRawImageDataSaved(java.lang.String number)
see if image data saved


getRawImageData

public byte[] getRawImageData(java.lang.String i)
retrieve byte data on disk


getRawImageDataParameter

public java.lang.Object getRawImageDataParameter(java.lang.String imageID,
                                                 java.lang.Integer key)
return parameter stored for image or null


JPedal Java PDF library 4.01b28 API Documentation - http://www.jpedal.org

JPedal Java PDF library 4.01b28 API Documentation - http://www.jpedal.org