Home Help Center

Whrere can I find the sample source about dynamic 'ami' and 'amd'

I read the online manual again. I recognize using dynamic 'ami' and 'amd' can reduce the copy time by using Ice.BaseStream. But I can't find more sample code expect the online manual. Can anybody show me some. Thanks a lot.

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Liwzh,

    The Ice/async demo illustrates both AMI and AMD.
    I recognize using dynamic 'ami' and 'amd' can reduce the copy time by using Ice.BaseStream.

    Can you describe in more details what you are trying to do?

    Cheers,
    Bernard
  • SystemSystem Member
    For example, I have a big bytes array in which the part is available.

    When using the Ice::ByteSeq, I have no choice but copy this. Beacause I can't give the function such as 'writeByteSeq(byte[],int offset,int length)' function.

    Is there any way not to do this extra copy? !
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    This byte-array optimization is unrelated to AMI or AMD.

    The relevant Ice for Java feature is "metadata", which allows you select the Java type used by Ice for your Slice types/parameters: Customizing the Java Mapping

    But unfortunately, there is no Java metadata that allows you to send just a subset of a byte-array. (We have such metadata in C++, but not Java).

    The only solution I see is creating a temporary array for your sub-array, using for example System.arraycopy.

    Cheers,
    Bernard
  • SystemSystem Member
    I see. Thanks!
Sign In or Register to comment.