code: public static byte[] toByteArray(short s, ByteOrder bo) {
      return ByteBuffer.allocate(2).order(bo).putShort(s).array();
    }
docs: Converts a short into a byte array.
  
  @param s
  a short
  @param bo
  a ByteOrder
  @return byte array