org.redkalex.source.pgsql.RespRowDataDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redkale-plugins Show documentation
Show all versions of redkale-plugins Show documentation
Redkale-Plugins -- java framework
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.redkalex.source.pgsql;
import org.redkale.util.ByteBufferReader;
/**
*
* @author zhangjx
*/
public class RespRowDataDecoder implements RespDecoder {
@Override
public byte messageid() {
return 'D';
}
@Override
public RowData read(final ByteBufferReader buffer, final int length, final byte[] bytes) {
byte[][] values = new byte[buffer.getShort()][];
for (int i = 0; i < values.length; i++) {
int sublength = buffer.getInt();
if (sublength != -1) {
values[i] = new byte[sublength];
buffer.get(values[i]);
} else {
values[i] = null;
}
}
return new RowData(values);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy