@Test public void testResourceToBytes(){ byte[] hasSubArray = ArrayHelper.resourceToBytes("validC32.xml"); Assert.assertNotNull(hasSubArray); }
public static byte[] resourceToBytes(String resourcePath){ ClassLoader loader = Thread.currentThread().getContextClassLoader(); InputStream is = loader.getResourceAsStream(resourcePath); byte[] bytes = new byte[0]; try { bytes = IOUtils.toByteArray(is); } catch (IOException e) { throw new DS4PException(e.toString(), e); } return bytes; }
ArrayHelper { public static byte[] resourceToBytes(String resourcePath){ ClassLoader loader = Thread.currentThread().getContextClassLoader(); InputStream is = loader.getResourceAsStream(resourcePath); byte[] bytes = new byte[0]; try { bytes = IOUtils.toByteArray(is); } catch (IOException e) { throw new DS4PException(e.toString(), e); } return bytes; } }
ArrayHelper { public static byte[] resourceToBytes(String resourcePath){ ClassLoader loader = Thread.currentThread().getContextClassLoader(); InputStream is = loader.getResourceAsStream(resourcePath); byte[] bytes = new byte[0]; try { bytes = IOUtils.toByteArray(is); } catch (IOException e) { throw new DS4PException(e.toString(), e); } return bytes; }  }
ArrayHelper { public static byte[] resourceToBytes(String resourcePath){ ClassLoader loader = Thread.currentThread().getContextClassLoader(); InputStream is = loader.getResourceAsStream(resourcePath); byte[] bytes = new byte[0]; try { bytes = IOUtils.toByteArray(is); } catch (IOException e) { throw new DS4PException(e.toString(), e); } return bytes; }  static boolean hasSubArray(byte[] array, byte[] arrayToFind); static char[] resourceToChars(String resourcePath); static byte[] resourceToBytes(String resourcePath); }
ArrayHelper { public static byte[] resourceToBytes(String resourcePath){ ClassLoader loader = Thread.currentThread().getContextClassLoader(); InputStream is = loader.getResourceAsStream(resourcePath); byte[] bytes = new byte[0]; try { bytes = IOUtils.toByteArray(is); } catch (IOException e) { throw new DS4PException(e.toString(), e); } return bytes; }  static boolean hasSubArray(byte[] array, byte[] arrayToFind); static char[] resourceToChars(String resourcePath); static byte[] resourceToBytes(String resourcePath);  }