*/
private List<WebSocketMessageDTO> buildMessageDTOs(ResultSet rs, boolean interpretLiteralBytes, int payloadLength) throws SQLException {
ArrayList<WebSocketMessageDTO> messages = new ArrayList<>();
try {
while (rs.next()) {
WebSocketMessageDTO message;
int channelId = rs.getInt("channel_id");
WebSocketChannelDTO channel = getChannel(channelId);
if (rs.getInt("fuzz_id") != 0) {
WebSocketFuzzMessageDTO fuzzMessage = new WebSocketFuzzMessageDTO(channel);
fuzzMessage.fuzzId = rs.getInt("fuzz_id");
fuzzMessage.state = WebSocketFuzzMessageDTO.State.valueOf(rs.getString("state"));
fuzzMessage.fuzz = rs.getString("fuzz");
message = fuzzMessage;
} else {
message = new WebSocketMessageDTO(channel);
}
message.id = rs.getInt("message_id");
message.setTime(rs.getTimestamp("timestamp"));
message.opcode = rs.getInt("opcode");
message.readableOpcode = WebSocketMessage.opcode2string(message.opcode);
// read payload
if (message.opcode == WebSocketMessage.OPCODE_BINARY) {