Пример #1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: public Response<Void> sendDataStream(final java.nio.channels.ReadableByteChannel data)
        public override Response <Void> SendDataStream(ReadableByteChannel data)
        {
            Serializer serializer = buffer =>
            {
                using (BlockLogBuffer writer = new BlockLogBuffer(buffer, (new Monitors()).newMonitor(typeof(ByteCounterMonitor))))
                {
                    writer.Write(data);
                }
            };

            return(SendRequest(MadeUpServer.MadeUpRequestType.SendDataStream, RequestContext, serializer, Protocol.VoidDeserializer));
        }
Пример #2
0
 public override void Write(ReadableByteChannel data)
 {
     try
     {
         using (BlockLogBuffer blockBuffer = new BlockLogBuffer(_target, (new Monitors()).newMonitor(typeof(ByteCounterMonitor))))
         {
             blockBuffer.Write(data);
         }
     }
     catch (IOException e)
     {
         throw new Exception(e);
     }
 }