public static LinkedBuffer writeLong(final long value, final WriteSession session,
            LinkedBuffer lb)
    {
        if (value == Long.MIN_VALUE)
        {
            final int valueLen = LONG_MIN_VALUE.length;
            if (lb.offset + valueLen > lb.buffer.length)
            {
                // TODO space efficiency (slower path)
                // not enough size
                lb = new LinkedBuffer(session.nextBufferSize, lb);
            }

            System.arraycopy(LONG_MIN_VALUE, 0, lb.buffer, lb.offset, valueLen);

            lb.offset += valueLen;
            session.size += valueLen;

            return lb;
        }

        final int size = (value < 0) ? stringSize(-value) + 1 : stringSize(value);

        if (lb.offset + size > lb.buffer.length)
        {
            // TODO space efficiency (slower path)
            // not enough size
            lb = new LinkedBuffer(session.nextBufferSize, lb);
        }

        putBytesFromLong(value, lb.offset, size, lb.buffer);

        lb.offset += size;
        session.size += size;

        return lb;
    }
Writes the stringified long into the {@link LinkedBuffer}.
protostuff-api/src/main/java/io/protostuff/StringSerializer.java