Re: Byte and char types

From: Thomas Wang <wang@xxx.hp.com>
Date: Fri Jun 16 2006 - 16:29:07 PDT

Scott Ferguson wrote:

> On Fri, 2006-06-16 at 15:07 -0400, Paul W. Cowan wrote:
>
> That's something we've been thinking about for a possible Hessian 1.1.
>
> The initial plan for Hessian was to make is as simple as possible. So
> Hessian 1.0 has a very few number of data types.
>
> We wouldn't add any data types, but we might could add extra compact
> encodings like the following:
>
> 0x80 - 0xbf = an integer in the range -32 to 31
> 0xc0 - 0xcf = 'S' 0x00 0x00 to 'S' 0x00 0x0f
> 0xd0 - 0xdf = 'B' 0x00 0x00 to 'B' 0x00 0x0f
> 0xe0 - 0xef = 'X' 0x00 0x00 to 'X' 0x00 0x0f
> 0xf0 = followed by 8-bit byte
> 0xf1 = followed by 16-bit short
> 0xf2 = 'S' with 8-bit length
> 0xf3 = 'B' with 8-bit length
> 0xf4 = 'X' with 8-bit length
> 0xf8 = 0.0
> 0xf9 = 1.0
>
>
> And also add an 'O' for Object definition and 'o' for object instance.
> The object definition might look like:
>
> O t 0x00 0x07 qa.Test
> S 0x00 0x03 foo
> S 0x00 0x03 bar
> z
>
> o I 0x00 0x00 0x00 0x00 (matches O's order)
> I 0x00 0x00 0x00 0x17 (value for foo)
> I 0x00 0x00 0x00 0x33 (value for bar)
>
> Compressed, that might look like
>
> o 0xc0
> 0xd7
> 0xf0 0x33
>
> Those wouldn't add any datatypes, just some compression of common
> values.
>
> Any comments?
>

Well, I personally do not like any of the new constructs. For practical
reasons, Hessian has not seen wide enough adoption to be adding
extensions to it. That will hinder adoption.

It seems to me the "ref" mechanism already works well enough to
compress duplicate references. I like to see better support for
Java 5 in the canned serializers. The serializer can gain some
efficiency by subsuming identical type names into enclosed "ref"
objects.

The CESU-8 encoding used by Hessian is still somewhat a problem for
cross-platform support. You can have the first part of a 16 bit
surrogate in the end of a chunk, and the second part of the surrogate
in the beginning of the next chunk. You may not be able to get
an array of unicodes just by processing at the chunk level.

  Thomas Wang
Received on Fri 16 Jun 2006 16:29:07 -0700

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:16:41 PDT