예제 #1
0
 public override void execute(BRemote __byps__remote, BAsyncResultIF <Object> __byps__asyncResult)
 {
     // checkpoint byps.gen.cs.GenApiClass:413
     try {
         RemoteStreams __byps__remoteT = (RemoteStreams)__byps__remote;
         BAsyncResultSendMethod <Dictionary <int, System.IO.Stream> > __byps__outerResult = new BAsyncResultSendMethod <Dictionary <int, System.IO.Stream> >(__byps__asyncResult, new byps.test.api.BResult_476459792());
         __byps__remoteT.GetImages(BAsyncResultHelper.ToDelegate(__byps__outerResult));
     } catch (Exception e) {
         __byps__asyncResult.setAsyncResult(null, e);
     }
 }
예제 #2
0
        private void internalTestRemoteStreamsManyStreams(int nbOfStreams)
        {
            IDictionary <int, Stream> streams = new Dictionary <int, Stream>();

            for (int i = 0; i < nbOfStreams; i++)
            {
                String str   = "hello-" + i;
                Stream istrm = new MemoryStream(Encoding.ASCII.GetBytes(str));
                streams[i] = istrm;
            }
            remote.SetImages(streams, -1);
            Dictionary <int, Stream> istrmsR = remote.GetImages();

            TestUtils.assertEquals(log, "streams", streams, istrmsR); // Does not compare streams.
            for (int i = 0; i < nbOfStreams; i++)
            {
                Stream     istrmR = istrmsR[i];
                ByteBuffer buf    = BWire.bufferFromStream(istrmR, false);
                String     strR   = Encoding.ASCII.GetString(buf.array(), buf.position(), buf.remaining());
                TestUtils.assertEquals(log, "stream", "hello-" + i, strR);
            }
        }