@Override
        public LinkedBuffer writeInt16(final int value,
                final WriteSession session, LinkedBuffer lb) throws IOException
        {
            session.size += 2;

            if (lb.offset + 2 > lb.buffer.length)
            {
                // grow
                lb = new LinkedBuffer(session.nextBufferSize, lb);
            }

            IntSerializer.writeInt16(value, lb.buffer, lb.offset);
            lb.offset += 2;

            return lb;
        }
The flexible output for outputs that use {@link WriteSession}.

@author David Yu
@created Sep 20, 2010
protostuff-api/src/main/java/io/protostuff/WriteSink.java