Here you can find the source of swapShort(short value)
Parameter | Description |
---|---|
value | the source value |
public static short swapShort(short value)
//package com.java2s; //License from project: Apache License public class Main { /**// w ww . ja v a 2s . c om * Reverses the byte order of the source <tt>short</tt> value * @param value the source value * @return the converted value */ public static short swapShort(short value) { return (short) (((value & 0xFF00) >> 8) | ((value & 0x00FF) << 8)); } }