public int spaceLeft()
    {
        if (output == null)
        {
            return limit - position;
        }
        else
        {
            throw new UnsupportedOperationException(
                    "spaceLeft() can only be called on CodedOutputs that are " +
                            "writing to a flat array.");
        }
    }
If writing to a flat array, return the space left in the array. Otherwise, throws
{@code UnsupportedOperationException}.
protostuff-core/src/test/java/io/protostuff/CodedOutput.java