public static ValueSetter valueSetterForEndian(ByteSetter bytes, byte endian) { if (endian == 0) { return new ValueSetter.XDR(bytes); } else if (endian == 1) { return new ValueSetter.NDR(bytes); } else { throw new IllegalArgumentException("Unknown Endian type:" + endian); } }
/** * Get the appropriate ValueGetter for my endianness * * @param bytes The ByteSetter * @param endian The endian to be used * @return the appropriate ValueSetter for the specified endian */ public static ValueSetter valueSetterForEndian(ByteSetter bytes, byte endian) { if (endian == ValueSetter.XDR.NUMBER) { // XDR return new ValueSetter.XDR(bytes); } else if (endian == ValueSetter.NDR.NUMBER) { return new ValueSetter.NDR(bytes); } else { throw new IllegalArgumentException("Unknown Endian type:" + endian); } }
/** * Get the appropriate ValueGetter for my endianness * * @param bytes The ByteSetter to use * @param endian the endian for the ValueSetter to use * @return the ValueGetter */ public static ValueSetter valueSetterForEndian(ByteSetter bytes, byte endian) { if (endian == ValueSetter.XDR.NUMBER) { // XDR return new ValueSetter.XDR(bytes); } else if (endian == ValueSetter.NDR.NUMBER) { return new ValueSetter.NDR(bytes); } else { throw new IllegalArgumentException("Unknown Endian type:" + endian); } }
/** * Get the appropriate ValueGetter for my endianness * * @param bytes The ByteSetter to use * @param endian the endian for the ValueSetter to use * @return the ValueGetter */ public static ValueSetter valueSetterForEndian(ByteSetter bytes, byte endian) { if (endian == ValueSetter.XDR.NUMBER) { // XDR return new ValueSetter.XDR(bytes); } else if (endian == ValueSetter.NDR.NUMBER) { return new ValueSetter.NDR(bytes); } else { throw new IllegalArgumentException("Unknown Endian type:" + endian); } }