write() публичный Метод

public write ( ByteBuffer src ) : int
src ByteBuffer
Результат int
Пример #1
0
        protected ByteBuffer writeAll(ByteBuffer dst)
        {
            int rem = (int)dst.remaining();

            while (rem > 0)
            {
                int now = sockChan.write(dst);
                rem -= now;
            }
            return(dst);
        }
Пример #2
0
        protected ByteBuffer writeAll(ByteBuffer dst)
        {
            int rem = (int)dst.remaining();
            int now = 0;

            while (rem > 0)
            {
                now = sockChan.write(dst);
                if (now < 0)
                {
                    //System.Console.Writeline("Write here ");
                    throw new IOException("Remote side closed connection!");
                }
                rem -= now;
            }
            return(dst);
        }