| | |
| | | public byte[] getBytes(short reqProtocolVersion) |
| | | throws UnsupportedEncodingException |
| | | { |
| | | |
| | | // Using current protocol version should normally not be done as we would |
| | | // normally call the getBytes() method instead for that. So this check |
| | | // for security |
| | | if (reqProtocolVersion == ProtocolVersion.getCurrentVersion()) |
| | | { |
| | | if (reqProtocolVersion == ProtocolVersion.REPLICATION_PROTOCOL_V1) |
| | | return getBytes_V1(); |
| | | else |
| | | return getBytes(); |
| | | } |
| | | |
| | | switch (reqProtocolVersion) |
| | | { |
| | | case ProtocolVersion.REPLICATION_PROTOCOL_V1: |
| | | return getBytes_V1(); |
| | | default: |
| | | // Unsupported requested version |
| | | throw new UnsupportedEncodingException(getClass().getSimpleName() + |
| | | " PDU does not support requested protocol version serialization: " + |
| | | reqProtocolVersion); |
| | | } |
| | | } |
| | | |
| | | /** |