DataCodingSpecification { public static int getMaxCharacters(byte dataCoding) { switch (dataCoding) { case 0:case 1: return 160; case 5:case 10:case 13: case 8: case 14: return 70; default: return 140; } }  static int getMaxCharacters(byte dataCoding); static String getCharsetName(byte dataCoding); static byte[] getMessageInBytes(String message, byte dataCoding); static final String US_ASCII; static final String ISO_8859_1; static final String ISO_8859_5; static final String ISO_8859_8; static final String UTF_16; static final String UTF_8; static final String EUC_KR; static final String EUC_JP; }
@Test public void testGetMaxCharacters() throws Exception { Assert.assertEquals(160, DataCodingSpecification.getMaxCharacters((byte)0)); Assert.assertEquals(160, DataCodingSpecification.getMaxCharacters((byte)1)); Assert.assertEquals(140, DataCodingSpecification.getMaxCharacters((byte)2)); Assert.assertEquals(140, DataCodingSpecification.getMaxCharacters((byte)3)); Assert.assertEquals(140, DataCodingSpecification.getMaxCharacters((byte)4)); Assert.assertEquals(70, DataCodingSpecification.getMaxCharacters((byte)5)); Assert.assertEquals(140, DataCodingSpecification.getMaxCharacters((byte)6)); Assert.assertEquals(140, DataCodingSpecification.getMaxCharacters((byte)7)); Assert.assertEquals(70, DataCodingSpecification.getMaxCharacters((byte)8)); Assert.assertEquals(70, DataCodingSpecification.getMaxCharacters((byte)10)); Assert.assertEquals(70, DataCodingSpecification.getMaxCharacters((byte)13)); Assert.assertEquals(70, DataCodingSpecification.getMaxCharacters((byte)14)); }