Ejemplo n.º 1
0
 /**
  * This will get an object from the pool.
  *
  * @param key The object key.
  * @return The object in the pool or a new one if it has not been parsed yet.
  * @throws IOException If there is an error getting the proxy object.
  */
 public COSObject getObjectFromPool(COSObjectKey key) throws IOException {
   COSObject obj = null;
   if (key != null) {
     obj = objectPool.get(key);
   }
   if (obj == null) {
     // this was a forward reference, make "proxy" object
     obj = new COSObject(null);
     if (key != null) {
       obj.setObjectNumber(COSInteger.get(key.getNumber()));
       obj.setGenerationNumber(COSInteger.get(key.getGeneration()));
       objectPool.put(key, obj);
     }
   }
   return obj;
 }
Ejemplo n.º 2
0
 /**
  * This is a convenience method that will convert the value to a COSInteger object.
  *
  * @param key The key to the object,
  * @param value The int value for the name.
  */
 public void setLong(COSName key, long value) {
   COSInteger intVal = null;
   intVal = COSInteger.get(value);
   setItem(key, intVal);
 }
Ejemplo n.º 3
0
 /**
  * This is a convenience method that will convert the value to a COSInteger object.
  *
  * @param key The key to the object,
  * @param value The int value for the name.
  */
 public void setInt(COSName key, int value) {
   setItem(key, COSInteger.get(value));
 }