internal BContentStream createStreamRequest(Stream strm) { if (streams == null) { streams = new List <BContentStream>(); } BContentStream bstrm = null; if (strm is BContentStream) { bstrm = (BContentStream)strm; } else { bstrm = new BContentStreamWrapper(strm); } // If the stream has already a streamId, it has been received // from the server. In this case, the application obviously // wants to forward the stream to another client. Thus // we do not have to upload the stream. if (bstrm.TargetId.isZero()) { BTargetId targetId = new BTargetId( transport.getConnectedServerId(), header.messageId, transport.getWire().makeMessageId()); bstrm.TargetId = targetId; streams.Add(bstrm); } return(bstrm); }
public BOutput(BTransport transport, BRegistry registry, int streamHeaderMagic, int negotiatedBypsVersion, long negotiatedVersion, ByteOrder negotiatedByteOrder) { this.objMap = transport.getApiDesc().uniqueObjects ? null : new BObjMap(); this.header = new BMessageHeader(streamHeaderMagic, negotiatedBypsVersion, negotiatedVersion, negotiatedByteOrder, transport.getWire().makeMessageId()); this.header.targetId = transport.getTargetId(); this.header.sessionId = transport.getSessionId(); this.transport = transport; this.registry = registry; this.streams = null; }