@Draft
    public ZMsg msgBinaryPicture(String picture, Object... args)
    {
        if (!BINARY_FORMAT.matcher(picture).matches()) {
            throw new ZMQException(picture + " is not in expected binary format " + BINARY_FORMAT.pattern(),
                    ZError.EPROTO);
        }
        ZMsg msg = new ZMsg();

        //  Pass 1: calculate total size of data frame
        int frameSize = 0;
        for (int index = 0; index < picture.length(); index++) {
            char pattern = picture.charAt(index);
            switch (pattern) {
            case '1': {
                frameSize += 1;
                break;
            }
            case '2': {
                frameSize += 2;
                break;
            }
            case '4': {
                frameSize += 4;
                break;
            }
            case '8': {
                frameSize += 8;
                break;
            }
            case 's': {
                String string = (String) args[index];
                frameSize += 1 + (string != null ? string.getBytes(ZMQ.CHARSET).length : 0);
                break;
            }
            case 'S': {
                String string = (String) args[index];
                frameSize += 4 + (string != null ? string.getBytes(ZMQ.CHARSET).length : 0);
                break;
            }
            case 'b':
            case 'c': {
                byte[] block = (byte[]) args[index];
                frameSize += 4 + block.length;
                break;
            }
            case 'f': {
                ZFrame frame = (ZFrame) args[index];
                msg.add(frame);
                break;
            }
            case 'm': {
                ZMsg other = (ZMsg) args[index];
                if (other == null) {
                    msg.add(new ZFrame((byte[]) null));
                }
                else {
                    msg.addAll(other);
                }
                break;
            }
            default:
                assert (false) : "invalid picture element '" + pattern + "'";
            }
        }

        //  Pass 2: encode data into data frame
        ZFrame frame = new ZFrame(new byte[frameSize]);
        ZNeedle needle = new ZNeedle(frame);
        for (int index = 0; index < picture.length(); index++) {
            char pattern = picture.charAt(index);
            switch (pattern) {
            case '1': {
                needle.putNumber1((int) args[index]);
                break;
            }
            case '2': {
                needle.putNumber2((int) args[index]);
                break;
            }
            case '4': {
                needle.putNumber4((int) args[index]);
                break;
            }
            case '8': {
                needle.putNumber8((long) args[index]);
                break;
            }
            case 's': {
                needle.putString((String) args[index]);
                break;
            }
            case 'S': {
                needle.putLongString((String) args[index]);
                break;
            }
            case 'b':
            case 'c': {
                byte[] block = (byte[]) args[index];
                needle.putNumber4(block.length);
                needle.putBlock(block, block.length);
                break;
            }
            case 'f':
            case 'm':
                break;
            default:
                assert (false) : "invalid picture element '" + pattern + "'";
            }
        }
        msg.addFirst(frame);
        return msg;
    }
@Test(expected = ZMQException.class)
    public void testInvalidBinaryPictureFormat()
    {
        String picture = "a";
        pic.msgBinaryPicture(picture, 255);
    }