> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On 
> Behalf Of Aruna Ireshan
> Sent: Monday, July 09, 2007 07:23
> To: [email protected]
> Subject: [Asn1] fast infoset algorithm
> 
> hi all.
> we are currently developing fast infoset in c language. At 
> there encoding algorithms are much more interesting part. So 
> i read several articles related to base64 encoding. 
> Ultimately feels the base64 encoding like this. It takes the 
> binary stream and divide them into parts including 6bits. 
> then it looks at the no in that each part. then according to 
> the no it looks at the character set table and find the 
> relevant no and take it as the representation of that. so 
> according to my knowledge that is the base64 encoding algorithm.
> But at the fast infoset specification it says about ten 
> encoding algorithms including base64 encoding algorithm. So i 
> need to know what is the basis of the remaining algorithms. 
> Whether it is same way like dividing into parts and assigning 
> relevant or different. Or if it same how does it divide and 
> how it results comparatively efficient.
> So any one who very sound with this area that is the one i m finding .


Do you have a copy of the standard?  If not, you can download it from the
ITU-T website for free.  The link is http://www.itu.int/rec/T-REC-X.891

(At this time, July 9, 11:47 EDT, there seems to be a broken link on the
ITU-T website, which prevents the download of this document.  Please try
again later.)

There are two ways of looking at encoding algorithms--a formal view and a
practical view.

The formal view focuses on the abstract infoset.  All the data in an infoset
consists of Unicode characters.  An attribute value is a character string.
An element may contain chunks of characters.  That data may mean different
things to you (e.g., it may represent a floating point number, a date/time,
an image) but for the infoset those are just characters.  An encoding
algorithm optimizes the encoding of certain strings of characters that are
present in an infoset.  The base64 algorithm, for instance, reduces the size
of a long base64 string present in an infoset by 25%.  This means that if
there is a chunk of characters somewhere (say, inside an element) which
matches the base64 format, you can apply the "base64" encoding algorithm to
that chunk of characters so that its encoding will take less space in the
fast infoset document that you are creating.

The practical view (which is probably more interesting) focuses on the
actual data you handle inside your program.  Encoding algorithms allow you
to bypass the conversion to/from a character string in certain cases.  For
example, if you have a 4-byte integer variable in your code (int32_t), which
you need to output into a fast infoset document, by using the "int" encoding
algorithm you can essentially dump your variable onto the fast infoset
document (so long as the byte order matches) and avoid converting your
integer value to a character string.  With XML, you would have to do that
conversion both when creating and when processing the XML document.
Likewise, if you are handling a binary data block (or "octet string") in
your code, which you need to output into a fast infoset document, by using
the "base64" encoding algorithm you can essentially dump your binary block
onto the fast infoset document and avoid converting your data block to a
base64 string or to a hexadecimal string.  With XML, you would have to do
that conversion both when creating and when processing the XML document.  

Therefore, from a practical standpoint, the use of encoding algorithms
allows you to reduce both the size of a fast infoset document and the time
spent creating it or processing it.  In some cases the benefits may be
significant (e.g., large binary blocks, arrays of floating point numbers).
You still need to make sure that the format of your variables (in memory)
matches the format associated with the standard encoding algorithm.  If it
does not, you still have the option of defining your own encoding algorithm,
although this may hinder interoperability.

Alessandro Triglia
OSS Nokalva




_______________________________________________
Asn1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1

Reply via email to