Class PDFNet.Obj
PDFNet.Obj
Constructor Attributes | Constructor Name and Description |
---|---|
PDFNet.Obj(id)
Obj is a concrete class for all SDF/Cos objects.
|
Method Attributes | Method Name and Description |
---|---|
erase(pos)
Removes an element in the dictionary from specified position.
|
|
eraseAt(pos)
Checks whether the position is within the array bounds and then removes it from the
array and moves each subsequent element to the slot with the next smaller index and
decrements the arrays length by 1.
|
|
eraseFromKey(key)
Removes an element in the dictionary that matches the given key.
|
|
find(key)
Search the dictionary for a given key.
|
|
findObj(key)
Search the dictionary for a given key.
|
|
get(key)
Search the dictionary for a given key and throw an exception if the key is not found.
|
|
Convert the SDF/Cos String object to 'PDF Text String' (a Unicode string).
|
|
getAt(index)
|
|
getBool()
|
|
getDoc()
|
|
getName()
|
|
getRawStream(decrypt)
|
|
getType()
|
|
insert(pos, input_obj)
Inserts an existing Obj in this array.
|
|
insertArray(pos)
Inserts an Obj::Type::e_array object in the array.
|
|
insertBool(pos, value)
Inserts an Obj::Type::e_bool object in the array.
|
|
insertDict(pos)
Inserts an Obj::Type::e_dict object in the array.
|
|
insertMatrix(pos, mtx)
Inserts an array of 6 numbers in this array.
|
|
insertName(pos, name)
Inserts an Obj::Type::e_name object in the array.
|
|
insertNull(pos)
Inserts an Obj::Type::e_null object in the array.
|
|
insertNumber(pos, value)
Inserts an Obj::Type::e_number object in the array.
|
|
insertRect(pos, x1, y1, x2, y2)
Inserts an array of 4 numbers in this array.
|
|
insertString(pos, value)
Inserts an Obj::Type::e_string object in the array.
|
|
insertStringWithSize(pos, value, size)
Inserts an Obj::Type::e_string object in the array.
|
|
insertText(pos, t)
Inserts an Obj::Type::e_string object in the array.
|
|
isArray()
|
|
isBool()
|
|
isDict()
|
|
isEqual(to)
|
|
isFree()
|
|
isLoaded()
|
|
isMarked()
|
|
isName()
|
|
isNull()
|
|
isNumber()
|
|
isStream()
|
|
isString()
|
|
pushBack(input_obj)
Appends an existing Obj at the end of the array.
|
|
Appends a new Obj::Type::e_array object at the end of the array.
|
|
pushBackBool(value)
Appends a new Obj::Type::e_bool object at the end of the array.
|
|
Appends a new Obj::Type::e_dict object at the end of the array.
|
|
pushBackMatrix(mtx)
Appends an array of 6 numbers at the end of the array.
|
|
pushBackName(name)
Appends a new Obj::Type::e_name object at the end of the array.
|
|
Appends a new Obj::Type::e_null object at the end of the array.
|
|
pushBackNumber(value)
Appends a new Obj::Type::e_number object at the end of the array.
|
|
pushBackRect(x1, y1, x2, y2)
Appends an array of 4 numbers at the end of the array.
|
|
pushBackString(value)
Appends a new Obj::Type::e_string object at the end of the array.
|
|
pushBackStringWithSize(value, size)
Appends a new Obj::Type::e_string object at the end of the array.
|
|
pushBackText(t)
Appends a new Obj::Type::e_string object at the end of the array.
|
|
put(key, input_obj)
Inserts a
|
|
putArray(key)
Inserts a
|
|
putBool(key, value)
Inserts a
|
|
putDict(key)
Inserts a
|
|
putMatrix(key, mtx)
Inserts a
|
|
putName(key, name)
Inserts a
|
|
putNull(key)
Inserts a
|
|
putNumber(key, value)
Inserts a
|
|
putRect(key, x1, y1, x2, y2)
Inserts a
|
|
putString(key, value)
Inserts a
|
|
putStringWithSize(key, value, size)
Inserts a
|
|
putText(key, t)
Inserts a
|
|
rename(old_key, new_key)
Change the key value of a dictionary entry.
|
|
setBool(b)
|
|
setMark(mark)
Set the object mark.
|
|
setName(name)
|
|
setNumber(n)
|
|
setStreamData(data, data_size)
[Documentation Not Yet Added]
|
|
setStreamDataWithFilter(data, data_size, filter_chain)
allows to replace the content stream with a new one
without creating a new object
|
|
setString(value)
[Documentation Not Yet Added]
|
|
setUString(value)
Sets the string object value.
|
|
size()
|
|
write(stream)
The function writes the Obj to the output stream
|
Class Detail
PDFNet.Obj(id)
Obj is a concrete class for all SDF/Cos objects. Obj hierarchy implements the
composite design pattern. As a result, you can invoke a member function of any
'derived' object through Obj interface. If the member function is not supported
(e.g. if you invoke Obj::GetNumber() on a boolean object) an Exception will be
thrown.
You can use GetType() or obl.Is???() member functions to find out type-information at
run time, however most of the time the type can be inferred from the PDF specification.
Therefore when you call Doc::GetTrailer() you can assume that returned object is
a dictionary. If there is any ambiguity use Is???() methods.
Objects can't be shared across documents, however you can use Doc::ImportObj()
to copy objects from one document to another.
Objects can be shared within a document provided that they are created as indirect.
Indirect objects are the ones that are referenced in cross-reference table.
To create an object as indirect use doc.CreateIndirect???() (where ? is the
Object type).
- Parameters:
- id
Method Detail
erase(pos)
Removes an element in the dictionary from specified position.
- Parameters:
- {DictIterator} pos
- A dictionary iterator indicating the position of the element to remove.
eraseAt(pos)
Checks whether the position is within the array bounds and then removes it from the
array and moves each subsequent element to the slot with the next smaller index and
decrements the arrays length by 1.
- Parameters:
- {number} pos
- The index for the array member to remove. Array indexes start at 0.
eraseFromKey(key)
Removes an element in the dictionary that matches the given key.
- Parameters:
- {string} key
- A string representing the key value of the element to remove.
{DictIterator}
find(key)
Search the dictionary for a given key.
- Parameters:
- {string} key
- a key to search for in the dictionary
- Returns:
- {DictIterator} A promise that resolves to the iterator to the matching key/value pair or invalid iterator (i.e. itr.HasNext()==fase) if the if the dictionary does not contain the given key.
{Obj}
findObj(key)
Search the dictionary for a given key.
- Parameters:
- {string} key
- a key to search for in the dictionary
- Returns:
- {Obj} A promise that resolves to nULL if the dictionary does not contain the specified key. Otherwise return the corresponding value.
{DictIterator}
get(key)
Search the dictionary for a given key and throw an exception if the key is not found.
- Parameters:
- {string} key
- a key to search for in the dictionary
- Returns:
- {DictIterator} A promise that resolves to obj::Null object if the value matching specified key is a Obj::Null object. otherwise return the iterator to the matching key/value pair.
{string}
getAsPDFText()
Convert the SDF/Cos String object to 'PDF Text String' (a Unicode string).
PDF Text Strings are not used to represent page content, however they
are used in text annotations, bookmark names, article names, document
information etc. These strings are encoded in either PDFDocEncoding or
Unicode character encoding. For more information on PDF Text Strings,
please refer to section 3.8.1 'Text Strings' in PDF Reference.
- Returns:
- {string} A promise that resolves to the Unicode string of the SDF/Cos String object
{Obj}
getAt(index)
- Parameters:
- {number} index
- The array element to obtain. The first element in an array has an index of zero.
- Returns:
- {Obj} A promise that resolves to an object of type: "Obj" (generated documentation)
{boolean}
getBool()
- Returns:
- {boolean} A promise that resolves to bool value if this is Bool.
{number}
getBuffer()
- Returns:
- {number} A promise that resolves to a pointer to the string buffer. Please note that the string may not be NULL terminated and that it may not be represented in ASCII or Unicode encoding. For more information on SDF/Cos String objects, please refer to section 3.2.3 'String Objects' in PDF Reference Manual.
{Filter}
getDecodedStream()
- Returns:
- {Filter} A promise that resolves to A filter to the decoded stream
{DictIterator}
getDictIterator()
- Returns:
- {DictIterator} A promise that resolves to an iterator that addresses the first element in the dictionary.
{SDFDoc}
getDoc()
- Returns:
- {SDFDoc} A promise that resolves to the document to which this object belongs.
{number}
getGenNum()
- Returns:
- {number} A promise that resolves to generation number. If this is not an Indirect object, generation number of a containing indirect object is returned.
{string}
getName()
- Returns:
- {string} A promise that resolves to string representing the Name object.
{number}
getNumber()
- Returns:
- {number} A promise that resolves to value, if this is Number.
{number}
getObjNum()
- Returns:
- {number} A promise that resolves to object number. If this is not an Indirect object, object number of a containing indirect object is returned.
{number}
getOffset()
- Returns:
- {number} A promise that resolves to object offset from the beginning of the file. If this is not an Indirect object, offset of a containing indirect object is returned.
{Filter}
getRawStream(decrypt)
- Parameters:
- {boolean} decrypt
- If true decrypt the stream if the stream is encrypted.
- Returns:
- {Filter} A promise that resolves to A filter to the encoded stream
{number}
getRawStreamLength()
- Returns:
- {number} A promise that resolves to the length of the raw/encoded stream equal to the Length parameter
{number}
getType()
Return value enum:PDFNet.Obj.Type = { e_null : 0 e_bool : 1 e_number : 2 e_name : 3 e_string : 4 e_dict : 5 e_array : 6 e_stream : 7 }
- Returns:
- {number} A promise that resolves to the object type.
{Obj}
insert(pos, input_obj)
Inserts an existing Obj in this array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- {Obj} input_obj
- The value to be inserted into the dictionary. If 'obj' is indirect (i.e. is a shared) object it will be inserted by reference, otherwise the object will be cloned and then inserted.
- Returns:
- {Obj} A promise that resolves to a newly inserted object.
{Obj}
insertArray(pos)
Inserts an Obj::Type::e_array object in the array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- Returns:
- {Obj} A promise that resolves to a newly created array object.
{Obj}
insertBool(pos, value)
Inserts an Obj::Type::e_bool object in the array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- {boolean} value
- The value of the Obj::Type::e_bool object to be inserted.
- Returns:
- {Obj} A promise that resolves to a newly created boolean object.
{Obj}
insertDict(pos)
Inserts an Obj::Type::e_dict object in the array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- Returns:
- {Obj} A promise that resolves to a newly created dictionary object.
{Obj}
insertMatrix(pos, mtx)
Inserts an array of 6 numbers in this array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- {matrix2d} mtx
- A matrix used to set the values in an array of six numbers. The resulting array will be then inserted in this array.
- Returns:
- {Obj} A promise that resolves to a newly created array object.
{Obj}
insertName(pos, name)
Inserts an Obj::Type::e_name object in the array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- {string} name
- The value of the Obj::Type::e_name object to be inserted.
- Returns:
- {Obj} A promise that resolves to a newly created name object.
{Obj}
insertNull(pos)
Inserts an Obj::Type::e_null object in the array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- Returns:
- {Obj} A promise that resolves to a newly created null object.
{Obj}
insertNumber(pos, value)
Inserts an Obj::Type::e_number object in the array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- {number} value
- The value of the Obj::Type::e_number object to be inserted.
- Returns:
- {Obj} A promise that resolves to a newly created number object.
{Obj}
insertRect(pos, x1, y1, x2, y2)
Inserts an array of 4 numbers in this array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- {number} x1
- The bottom left x value of the rect to be inserted
- {number} y1
- The bottom left y value of the rect to be inserted
- {number} x2
- The top right x value of the rect to be inserted
- {number} y2
- The top right y value of the rect to be inserted
- Returns:
- {Obj} A promise that resolves to a newly created array object.
{Obj}
insertString(pos, value)
Inserts an Obj::Type::e_string object in the array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- {string} value
- The value of the Obj::Type::e_string object to be inserted.
- Returns:
- {Obj} A promise that resolves to a newly created string object.
{Obj}
insertStringWithSize(pos, value, size)
Inserts an Obj::Type::e_string object in the array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- {string} value
- The buffer used to set the value of the Obj::Type::e_string object to be inserted.
- {number} size
- The number of bytes to copy from the 'value' buffer parameter.
- Returns:
- {Obj} A promise that resolves to a newly created string object.
{Obj}
insertText(pos, t)
Inserts an Obj::Type::e_string object in the array.
- Parameters:
- {number} pos
- The location in the array to insert the object . The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= Array->Length(), appends obj to array.
- {string} t
- The value of the Obj::Type::e_string object to be inserted.
- Returns:
- {Obj} A promise that resolves to a newly created string object.
{boolean}
isArray()
- Returns:
- {boolean} A promise that resolves to true if this is an Array, false otherwise.
{boolean}
isBool()
- Returns:
- {boolean} A promise that resolves to true if this is a Bool object, false otherwise.
{boolean}
isContainer()
- Returns:
- {boolean} A promise that resolves to true if this is a Container (a dictionary, array, or a stream), false otherwise.
{boolean}
isDict()
- Returns:
- {boolean} A promise that resolves to true if this is a dictionary (i.e. Dict), false otherwise.
{boolean}
isEqual(to)
- Parameters:
- {Obj} to
- Obj to compare to
- Returns:
- {boolean} A promise that resolves to true if two Obj's point to the same object. This method does not compare object content. For this operation use IsEqualValue() instead.
{boolean}
isFree()
- Returns:
- {boolean} A promise that resolves to true if the object is in use or is marked as free.
{boolean}
isIndirect()
- Returns:
- {boolean} A promise that resolves to true if this is Indirect object (i.e. object referenced in the cross-reference table), false otherwise.
{boolean}
isLoaded()
- Returns:
- {boolean} A promise that resolves to true if the object is loaded in memory.
{boolean}
isMarked()
- Returns:
- {boolean} A promise that resolves to true if the object is marked.
{boolean}
isName()
- Returns:
- {boolean} A promise that resolves to true if this is Name, false otherwise.
{boolean}
isNull()
- Returns:
- {boolean} A promise that resolves to true if this is a Null object, false otherwise.
{boolean}
isNumber()
- Returns:
- {boolean} A promise that resolves to true if this is a Number object, false otherwise.
{boolean}
isStream()
- Returns:
- {boolean} A promise that resolves to true if this is a Stream, false otherwise.
{boolean}
isString()
- Returns:
- {boolean} A promise that resolves to true if this is a Str (String) object, false otherwise.
{Obj}
pushBack(input_obj)
Appends an existing Obj at the end of the array.
- Parameters:
- {Obj} input_obj
- The value to be inserted into the dictionary. If 'obj' is indirect (i.e. is a shared) object it will be inserted by reference, otherwise the object will be cloned and then appended.
- Returns:
- {Obj} A promise that resolves to a newly appended object.
{Obj}
pushBackArray()
Appends a new Obj::Type::e_array object at the end of the array.
- Returns:
- {Obj} A promise that resolves to the new array object.
{Obj}
pushBackBool(value)
Appends a new Obj::Type::e_bool object at the end of the array.
- Parameters:
- {boolean} value
- The value of the Obj::Type::e_bool object.
- Returns:
- {Obj} A promise that resolves to the new boolean object.
{Obj}
pushBackDict()
Appends a new Obj::Type::e_dict object at the end of the array.
- Returns:
- {Obj} A promise that resolves to the new dictionary object.
{Obj}
pushBackMatrix(mtx)
Appends an array of 6 numbers at the end of the array.
- Parameters:
- {matrix2d} mtx
- A matrix used to set the values in an array of six numbers. The resulting array will be then inserted in this array.
- Returns:
- {Obj} A promise that resolves to a newly appended array object.
{Obj}
pushBackName(name)
Appends a new Obj::Type::e_name object at the end of the array.
- Parameters:
- {string} name
- The value of the Obj::Type::e_name object.
- Returns:
- {Obj} A promise that resolves to the new array object.
{Obj}
pushBackNull()
Appends a new Obj::Type::e_null object at the end of the array.
- Returns:
- {Obj} A promise that resolves to the new null object.
{Obj}
pushBackNumber(value)
Appends a new Obj::Type::e_number object at the end of the array.
- Parameters:
- {number} value
- The value of the Obj::Type::e_number object.
- Returns:
- {Obj} A promise that resolves to the new number object.
{Obj}
pushBackRect(x1, y1, x2, y2)
Appends an array of 4 numbers at the end of the array.
- Parameters:
- {number} x1
- The bottom left x value of the rect to be inserted
- {number} y1
- The bottom left y value of the rect to be inserted
- {number} x2
- The top right x value of the rect to be inserted
- {number} y2
- The top right y value of the rect to be inserted
- Returns:
- {Obj} A promise that resolves to a newly appended array object.
{Obj}
pushBackString(value)
Appends a new Obj::Type::e_string object at the end of the array.
- Parameters:
- {string} value
- The value of the Obj::Type::e_string object.
- Returns:
- {Obj} A promise that resolves to the new string object.
{Obj}
pushBackStringWithSize(value, size)
Appends a new Obj::Type::e_string object at the end of the array.
- Parameters:
- {string} value
- The buffer used to set the value of the Obj::Type::e_string object to be inserted.
- {number} size
- The number of bytes to copy from the 'value' buffer parameter.
- Returns:
- {Obj} A promise that resolves to the new string object.
{Obj}
pushBackText(t)
Appends a new Obj::Type::e_string object at the end of the array.
- Parameters:
- {string} t
- The value of the Obj::Type::e_string object to be inserted.
- Returns:
- {Obj} A promise that resolves to the new string object.
{Obj}
put(key, input_obj)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- {Obj} input_obj
- The value to be inserted into the dictionary. If 'obj' is indirect (i.e. is a shared) object it will be inserted by reference, otherwise the object will be cloned and then inserted into the dictionary.
- Returns:
- {Obj} A promise that resolves to a newly inserted object.
{Obj}
putArray(key)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- Returns:
- {Obj} A promise that resolves to a newly created array object.
{Obj}
putBool(key, value)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- {boolean} value
- The value of the Obj::Type::e_bool object to be inserted into the dictionary.
- Returns:
- {Obj} A promise that resolves to a newly created boolean object.
{Obj}
putDict(key)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- Returns:
- {Obj} A promise that resolves to a newly created dictionary.
{Obj}
putMatrix(key, mtx)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- {matrix2d} mtx
- A matrix used to set the values in an array of six numbers. The resulting array will be inserted into the dictionary.
- Returns:
- {Obj} A promise that resolves to a newly created array object.
{Obj}
putName(key, name)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- {string} name
- The value of the Obj::Type::e_name object to be inserted into the dictionary.
- Returns:
- {Obj} A promise that resolves to a newly created name object.
putNull(key)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
{Obj}
putNumber(key, value)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- {number} value
- The value of the Obj::Type::e_number object to be inserted into the dictionary.
- Returns:
- {Obj} A promise that resolves to a newly created number object.
{Obj}
putRect(key, x1, y1, x2, y2)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- {number} x1
- The bottom left x value of the rect to be inserted
- {number} y1
- The bottom left y value of the rect to be inserted
- {number} x2
- The top right x value of the rect to be inserted
- {number} y2
- The top right y value of the rect to be inserted
- Returns:
- {Obj} A promise that resolves to a newly created array object.
{Obj}
putString(key, value)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- {string} value
- The value of the Obj::Type::e_string object to be inserted into the dictionary.
- Returns:
- {Obj} A promise that resolves to a newly created string object.
{Obj}
putStringWithSize(key, value, size)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- {string} value
- The buffer used to set the value of the Obj::Type::e_string object to be inserted into the dictionary.
- {number} size
- The number of bytes to copy from the 'value' buffer parameter.
- Returns:
- {Obj} A promise that resolves to a newly created string object.
{Obj}
putText(key, t)
Inserts a pair in the dictionary.
- Parameters:
- {string} key
- The key of the value to set.
- {string} t
- The value of the Obj::Type::e_string object to be inserted into the dictionary.
- Returns:
- {Obj} A promise that resolves to a newly created string object.
{[ERROR]}
rename(old_key, new_key)
Change the key value of a dictionary entry.
The key can't be renamed if another key with the same name already exists
in the dictionary. In this case Rename returns false.
- Parameters:
- {string} old_key
- A string representing the key value to be changed.
- {string} new_key
- A string representing the key value that the old key is changed into.
- Returns:
- {[ERROR]} A promise that resolves to an unknown type (generated documentation)
setBool(b)
- Parameters:
- {boolean} b
- bool value used to set Bool object.
setMark(mark)
Set the object mark. Mark is a boolean value that can be associated with every
indirect object. This is especially useful when an object graph should be
traversed and an operation should be performed on each node only once.
- Parameters:
- {boolean} mark
- boolean value that the object's mark should be set to.
setName(name)
- Parameters:
- {string} name
- value used to set Name object.
setNumber(n)
- Parameters:
- {number} n
- value used to set Number object.
setStreamData(data, data_size)
[Documentation Not Yet Added]
- Parameters:
- {string} data
- (generated documentation)
- {number} data_size
- (generated documentation)
setStreamDataWithFilter(data, data_size, filter_chain)
allows to replace the content stream with a new one
without creating a new object
- Parameters:
- {string} data
- (generated documentation)
- {number} data_size
- (generated documentation)
- {Filter} filter_chain
- (generated documentation)
setString(value)
[Documentation Not Yet Added]
- Parameters:
- {string} value
- (generated documentation)
setUString(value)
Sets the string object value.
- Parameters:
- {string} value
- A Unicode string value.
{number}
size()
- Returns:
- {number} A promise that resolves to the 'size' of the object. The definition of 'size' depends on the object type. In particular: For a dictionary or a stream object, the method will return the number of key/value pairs in the dictionary. For an array object the method will return the number of Obj entries in the array. For a string object the method will return the number of bytes in the string buffer. For any other object the method will always return 1.
write(stream)
The function writes the Obj to the output stream
- Parameters:
- {FilterWriter} stream
- the input stream where the Obj will be written