View Javadoc
1   package org.sim0mq.message;
2   
3   /**
4    * String encoding indicating UTF8 or UTF16 strings.
5    * <p>
6    * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
7    * BSD-style license. See <a href="http://sim0mq.org/docs/current/license.html">Sim0MQ License</a>.
8    * </p>
9    * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
10   * initial version Aug 9, 2018 <br>
11   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
12   */
13  public enum StringEncoding
14  {
15      /** 8 bits String and char encoding. */
16      UTF8,
17  
18      /** 16 bits String and char encoding. */
19      UTF16;
20  
21      /**
22       * Return whether the string encoding is UTF8.
23       * @return boolean; indicates whether the String encoding is UTF8
24       */
25      public boolean isUTF8()
26      {
27          return this.equals(UTF8);
28      }
29  
30      /**
31       * Return whether the string encoding is UTF16.
32       * @return boolean; indicates whether the String encoding is UTF16
33       */
34      public boolean isUTF16()
35      {
36          return this.equals(UTF16);
37      }
38  }