private void drainFrom(BlockingQueue<ZMsg> in) {
                int lastIndex = lastValidIndex = -1;
                ZMsg msg;
                while (++lastIndex < buffer.length && (msg = in.poll()) != null) {
                    buffer[lastIndex] = msg;
                    lastValidIndex = lastIndex;
                }
            }