@Test public void testUnwrapWithJunkCharacters() throws Exception { String s = "0001??020\rzz\n30z40..506\r\n07;;"; byte[] expected = new byte[] {0, 1, 2, 3, 4, 5, 6, 7}; assertArrayEquals(expected, AsciiArmour.unwrap(s)); }
static byte[] unwrap(String s) throws FormatException { try { return StringUtils.fromHexString(s.replaceAll("[^0-9a-fA-F]", "")); } catch (IllegalArgumentException e) { throw new FormatException(); } }
AsciiArmour { static byte[] unwrap(String s) throws FormatException { try { return StringUtils.fromHexString(s.replaceAll("[^0-9a-fA-F]", "")); } catch (IllegalArgumentException e) { throw new FormatException(); } } }
AsciiArmour { static byte[] unwrap(String s) throws FormatException { try { return StringUtils.fromHexString(s.replaceAll("[^0-9a-fA-F]", "")); } catch (IllegalArgumentException e) { throw new FormatException(); } }  }
AsciiArmour { static byte[] unwrap(String s) throws FormatException { try { return StringUtils.fromHexString(s.replaceAll("[^0-9a-fA-F]", "")); } catch (IllegalArgumentException e) { throw new FormatException(); } }   }
AsciiArmour { static byte[] unwrap(String s) throws FormatException { try { return StringUtils.fromHexString(s.replaceAll("[^0-9a-fA-F]", "")); } catch (IllegalArgumentException e) { throw new FormatException(); } }    }