public LinkedBuffer packArrayHeader(int arraySize, WriteSession session, LinkedBuffer lb)
            throws IOException
    {
        if (arraySize < 0)
        {
            throw new IllegalArgumentException("array size must be >= 0");
        }

        if (arraySize < (1 << 4))
        {
            return sink.writeByte((byte) (FIXARRAY_PREFIX | arraySize), session, lb);
        }
        else if (arraySize < (1 << 16))
        {
            return writeByteAndShort(ARRAY16, (short) arraySize, session, lb);
        }
        else
        {
            return writeByteAndInt(ARRAY32, arraySize, session, lb);
        }
    }
Simple wrapper around WriteSink with methods specific for MessagePacker

@author Alex Shvid
protostuff-msgpack/src/main/java/io/protostuff/MsgpackWriteSink.java