Results 1 to 4 of 4

Thread: Ice 3.2.1: Java stream helper functions

  1. #1
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159

    Ice 3.2.1: Java stream helper functions

    I compiled some slice IDL with slice2java using the --stream option.
    The resulting code does not compile. It might be my fault, but I don't know how to solve it.

    The IDL in question is:

    Code:
      struct Prop {
        int Index;
        Ice::ByteSeq Value;
      };
    The last two methods in the generated code below do not compile, as it seems their parameter (of type InputStream or OutputStream) does not match the parameter type needed to pass to ByteSeqHelper.read/write:
    (I have marked the problem spots with a comment)


    Code:
    public final class Prop implements java.lang.Cloneable
    {
        public int Index;
    
        public byte[] Value;
    
        . . . 
    
        public void
        __write(IceInternal.BasicStream __os)
        {
            __os.writeInt(Index);
            Ice.ByteSeqHelper.write(__os, Value);
        }
    
        public void
        __read(IceInternal.BasicStream __is)
        {
            Index = __is.readInt();
            Value = Ice.ByteSeqHelper.read(__is);
        }
    
        public void
        ice_write(Ice.OutputStream __outS)
        {
            __outS.writeInt(Index);
            Ice.ByteSeqHelper.write(__outS, Value);  // issue here
        }
    
        public void
        ice_read(Ice.InputStream __inS)
        {
            Index = __inS.readInt();
            Value = Ice.ByteSeqHelper.read(__inS);  // issue here
        }

    Karl
    Karl Waclawek

  2. #2
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    Thanks for the bug report Karl, I'll have a look at this.

    Cheers,

    Michi.

  3. #3
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    Hi Karl,

    the problem arises because BuiltinSequences.ice is not compiled with the --stream option. As a result, the generated Helper class does not have the method to marshal the stream, and you get the compilation error.

    One way to solve this is to recompile BuiltinSequences.ice with --stream and to rebuild the Ice.jar file.

    Another way would be to not use Ice::ByteSeq and instead define your own byte sequence type, which you compile with --stream.

    Cheers,

    Michi.

  4. #4
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159
    Quote Originally Posted by michi View Post
    Hi Karl,

    the problem arises because BuiltinSequences.ice is not compiled with the --stream option. As a result, the generated Helper class does not have the method to marshal the stream, and you get the compilation error.

    One way to solve this is to recompile BuiltinSequences.ice with --stream and to rebuild the Ice.jar file.

    Another way would be to not use Ice::ByteSeq and instead define your own byte sequence type, which you compile with --stream.

    Cheers,

    Michi.
    I understand. I am using only a few built-in Slice types, so it's not much
    work to throw them out.

    Thanks,

    Karl
    Karl Waclawek

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. calling Ice interface functions locally
    By rpeters in forum Help Center
    Replies: 6
    Last Post: 07-14-2010, 04:02 PM
  2. How do I use Ice to process stream
    By hyz1840 in forum Help Center
    Replies: 3
    Last Post: 05-25-2006, 07:19 AM
  3. Stream helper functions and C++ templates
    By copton in forum Help Center
    Replies: 7
    Last Post: 01-20-2006, 02:37 PM
  4. Java Object Output Stream and Ice
    By brian in forum Help Center
    Replies: 8
    Last Post: 10-31-2005, 10:18 AM
  5. Generated Java Helper class has errors
    By ygarbourg in forum Help Center
    Replies: 2
    Last Post: 05-06-2005, 02:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •