public static ProducerRequest readFrom(ByteBuffer buffer) {
        String topic = Utils.readShortString(buffer);
        int partition = buffer.getInt();
        int messageSetSize = buffer.getInt();
        ByteBuffer messageSetBuffer = buffer.slice();
        messageSetBuffer.limit(messageSetSize);
        buffer.position(buffer.position() + messageSetSize);
        return new ProducerRequest(topic, partition, new ByteBufferMessageSet(messageSetBuffer));
    }
public static ProducerRequest readFrom ( ByteBuffer buffer ) { String topic = Utils . readShortString ( buffer ) ; int partition = buffer . getInt ( ) ; int messageSetSize = buffer . getInt ( ) ; ByteBuffer messageSetBuffer = buffer . slice ( ) ; messageSetBuffer . limit ( messageSetSize ) ; buffer . position ( buffer . position ( ) + messageSetSize ) ; return new ProducerRequest ( topic , partition , new ByteBufferMessageSet ( messageSetBuffer ) ) ; }
read a producer request from buffer

@param buffer data buffer
@return parsed producer request