@Override public TcpOption newInstance(byte[] rawData, int offset, int length) { try { return UnknownTcpOption.newInstance(rawData, offset, length); } catch (IllegalRawDataException e) { return IllegalTcpOption.newInstance(rawData, offset, length); } }
/** @return a new IllegalTcpOption object. */ public IllegalTcpOption build() { return new IllegalTcpOption(this); } }
@Override public TcpOption newInstance(byte[] rawData, int offset, int length, TcpOptionKind number) { if (rawData == null || number == null) { StringBuilder sb = new StringBuilder(40); sb.append("rawData: ").append(rawData).append(" number: ").append(number); throw new NullPointerException(sb.toString()); } try { Instantiater instantiater = instantiaters.get(number); if (instantiater != null) { return instantiater.newInstance(rawData, offset, length); } } catch (IllegalRawDataException e) { return IllegalTcpOption.newInstance(rawData, offset, length); } return newInstance(rawData, offset, length); }
/** * A static factory method. This method validates the arguments by {@link * ByteArrays#validateBounds(byte[], int, int)}, which may throw exceptions undocumented here. * * @param rawData rawData * @param offset offset * @param length length * @return a new IllegalTcpOption object. */ public static IllegalTcpOption newInstance(byte[] rawData, int offset, int length) { ByteArrays.validateBounds(rawData, offset, length); return new IllegalTcpOption(rawData, offset, length); }
} catch (InvocationTargetException e) { if (e.getTargetException() instanceof IllegalRawDataException) { return IllegalTcpOption.newInstance(rawData, offset, length);
/** @return a new IllegalTcpOption object. */ public IllegalTcpOption build() { return new IllegalTcpOption(this); } }
@Override public TcpOption newInstance(byte[] rawData, int offset, int length) { try { return UnknownTcpOption.newInstance(rawData, offset, length); } catch (IllegalRawDataException e) { return IllegalTcpOption.newInstance(rawData, offset, length); } }
/** * A static factory method. This method validates the arguments by {@link * ByteArrays#validateBounds(byte[], int, int)}, which may throw exceptions undocumented here. * * @param rawData rawData * @param offset offset * @param length length * @return a new IllegalTcpOption object. */ public static IllegalTcpOption newInstance(byte[] rawData, int offset, int length) { ByteArrays.validateBounds(rawData, offset, length); return new IllegalTcpOption(rawData, offset, length); }
@Override public TcpOption newInstance(byte[] rawData, int offset, int length, TcpOptionKind number) { if (rawData == null || number == null) { StringBuilder sb = new StringBuilder(40); sb.append("rawData: ").append(rawData).append(" number: ").append(number); throw new NullPointerException(sb.toString()); } try { Instantiater instantiater = instantiaters.get(number); if (instantiater != null) { return instantiater.newInstance(rawData, offset, length); } } catch (IllegalRawDataException e) { return IllegalTcpOption.newInstance(rawData, offset, length); } return newInstance(rawData, offset, length); }
} catch (InvocationTargetException e) { if (e.getTargetException() instanceof IllegalRawDataException) { return IllegalTcpOption.newInstance(rawData, offset, length);