コード例 #1
0
        public override Object read(Object obj, BInput bin1, long version)
        {
            BInputBin       bin      = ((BInputBin)bin1);
            BRemote         remote   = null;
            BTargetId       targetId = BTargetId.read(bin.bbuf.getBuffer(), bin1.header.bversion);
            BRemoteRegistry rreg     = bin.transport.getRemoteRegistry();

            if (rreg != null)
            {
                remote = rreg.getRemote(bin.header.targetId, targetId, typeId);
            }
            else
            {
                BTransport transport = new BTransport(bin.transport, targetId);
                remote = internalCreate(transport);
            }
            return(remote);
        }
コード例 #2
0
ファイル: BMessageHeader.cs プロジェクト: ThomasEcherer/elo
        private void readBinaryWithoutMagic(ByteBuffer buf)
        {
            error = buf.getInt();
            flags = buf.getInt();

            if ((flags & FLAG_BYPS_VERSION) != 0)
            {
                bversion = buf.getInt();
            }

            version   = buf.getLong();
            targetId  = BTargetId.read(buf, bversion);
            messageId = buf.getLong();

            if (bversion >= BYPS_VERSION_WITH_SESSIONID)
            {
                sessionId = BTargetId.readSessionId(buf);
            }
        }
コード例 #3
0
        public override Object read(Object obj, BInput bin1, long version)
        {
            BInputBin bin            = ((BInputBin)bin1);
            BTargetId targetId       = null;
            long      contentLength  = -1;
            String    contentType    = BContentStream.DEFAULT_CONTENT_TYPE;
            int       attachmentCode = 0;
            String    fileName       = "";
            bool      withProps      = bin1.header.bversion >= BMessageHeader.BYPS_VERSION_EXTENDED_STREAM_INFORMATION;

            if (withProps)
            {
                targetId       = BTargetId.read(bin.bbuf.getBuffer(), bin1.header.bversion);
                contentLength  = bin.bbuf.getLong();
                contentType    = bin.bbuf.getString();
                attachmentCode = bin.bbuf.getInt();
                fileName       = bin.bbuf.getString();
            }
            else
            {
                long streamId  = bin.bbuf.getLong();
                int  serverId  = bin1.transport.getTargetId().getServerId();
                long messageId = bin1.header.messageId;
                targetId = new BTargetId(serverId, messageId, streamId);
            }

            try
            {
                BContentStream strm = bin.transport.getWire().getStream(targetId);
                bin.onObjectCreated(strm);
                strm.ContentLength  = contentLength;
                strm.ContentType    = contentType;
                strm.AttachmentCode = attachmentCode;
                strm.FileName       = fileName;
                return(strm);
            }
            catch (IOException e)
            {
                throw new BException(BExceptionC.IOERROR, e.Message);
            }
        }