[Glass] How to properly write bytes objects into binary streams?

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Wed Sep 3 12:10:14 PDT 2014


My point is that LargeIntegers are not polymorphic byte-objects (no methods
for accessing the bytes for a LargeInteger) ... in GemStone

Dale


On Wed, Sep 3, 2014 at 11:58 AM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

>
>
>
> On Wed, Sep 3, 2014 at 3:48 PM, Dale Henrichs <
> dale.henrichs at gemtalksystems.com> wrote:
>
>> Take a look at Integer class>>_new:neg: ... the implication is that you
>> might need to store "digits" instead of bytes ....
>>
>>
> Thanks Dale. But that only works for Integers. I am looking for a
> polimorphic way for all type of byte-objects that are not
> SequenceableCollection subclasses. Float, Character, LargeInteger, Integer
> etc. OK, I do have the polimorphic way to get all bytes and write it to the
> binary stream using  #_basicSize and #basicAt: . But then I am missing the
> materialization part. Actually, I miss the instance creation method to
> create an instance with a concrete size, so that I can then do the
> #_basicAt:put:
>
> Thanks,
>
>
>
>> Dale
>>
>>
>> On Wed, Sep 3, 2014 at 11:43 AM, Mariano Martinez Peck via Glass <
>> glass at lists.gemtalksystems.com> wrote:
>>
>>>
>>>
>>>
>>> On Wed, Sep 3, 2014 at 1:12 PM, Martin McClure <
>>> martin.mcclure at gemtalksystems.com> wrote:
>>>
>>>> On 09/03/2014 06:58 AM, Mariano Martinez Peck wrote:
>>>>
>>>>>
>>>>>
>>>> [...]
>>>>
>>>>
>>>>
>>>>> But again, I want to go step by step.
>>>>>
>>>>>     If the answer to either of these is "yes," then things get a bit
>>>>>     more complicated.
>>>>>
>>>>>
>>>>> Even if they would be desired later, right now, I am fine with a "No"
>>>>> answer.
>>>>>
>>>>>
>>>> OK, for the limited gs-to-gs case, same endianness...
>>>>
>>>> Since in GemStone #replaceFrom:to:with: expects to be copying from a
>>>> collection, not (for instance) a LargeInteger, the most generic way to copy
>>>> the bytes of a byte object is probably to write a loop that uses
>>>> #_basicSize and #_basicAt: to access the bytes.
>>>>
>>>
>>> OK. Thanks. But then how can I create an empty instance of one of them,
>>> in a general way, and with a certain size? I tried:
>>>
>>> LargeInteger _basicNew: 10
>>>
>>> But it fails.
>>>
>>> Thanks,
>>>
>>>
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>> _______________________________________________
>>> Glass mailing list
>>> Glass at lists.gemtalksystems.com
>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>>
>>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20140903/8b84cb56/attachment.html>


More information about the Glass mailing list