@Override
public List<OFQueueProperty> parseQueueProperties(ByteBuffer data,
int length, int limit) {
List<OFQueueProperty> results = new ArrayList<OFQueueProperty>();
OFQueueProperty demux = new OFQueueProperty();
OFQueueProperty ofqp;
int end = data.position() + length;
while (limit == 0 || results.size() <= limit) {
if (data.remaining() < OFQueueProperty.MINIMUM_LENGTH ||
(data.position() + OFQueueProperty.MINIMUM_LENGTH) > end)
return results;
data.mark();
demux.readFrom(data);
data.reset();
if (demux.getLengthU() > data.remaining() ||
(data.position() + demux.getLengthU()) > end)
return results;
ofqp = getQueueProperty(demux.getType());
ofqp.readFrom(data);
if (OFQueueProperty.class.equals(ofqp.getClass())) {
// advance the position for un-implemented messages
data.position(data.position()+(ofqp.getLengthU() -
OFQueueProperty.MINIMUM_LENGTH));
}
results.add(ofqp);
}