@Override
public List<OFStatistics> parseStatistics(OFType t, OFStatisticsType st,
ByteBuffer data, int length, int limit) {
List<OFStatistics> results = new ArrayList<OFStatistics>();
OFStatistics statistics = getStatistics(t, st);
int start = data.position();
int count = 0;
while (limit == 0 || results.size() <= limit) {
// TODO Create a separate MUX/DEMUX path for vendor stats
if (statistics instanceof OFVendorStatistics)
((OFVendorStatistics)statistics).setLength(length);
/**
* can't use data.remaining() here, b/c there could be other data
* buffered past this message
*/
if ((length - count) >= statistics.getLength()) {
if (statistics instanceof OFActionFactoryAware)
((OFActionFactoryAware)statistics).setActionFactory(this);
statistics.readFrom(data);
results.add(statistics);
count += statistics.getLength();
statistics = getStatistics(t, st);
} else {
if (count < length) {
/**
* Nasty case: partial/incomplete statistic found even