@Test void testConvert() { byte[] bytes = "Hello, world!".getBytes(); InputStream inputStream = new ByteArrayInputStream(bytes); byte[] actual = testSubject.convert(inputStream); assertArrayEquals(bytes, actual); }
@Override public byte[] convert(InputStream original) { try { return bytesFrom(original); } catch (IOException e) { throw new CannotConvertBetweenTypesException("Unable to convert InputStream to byte[]. " + "Error while reading from Stream.", e); } }
InputStreamToByteArrayConverter implements ContentTypeConverter<InputStream, byte[]> { @Override public byte[] convert(InputStream original) { try { return bytesFrom(original); } catch (IOException e) { throw new CannotConvertBetweenTypesException("Unable to convert InputStream to byte[]. " + "Error while reading from Stream.", e); } } }
InputStreamToByteArrayConverter implements ContentTypeConverter<InputStream, byte[]> { @Override public byte[] convert(InputStream original) { try { return bytesFrom(original); } catch (IOException e) { throw new CannotConvertBetweenTypesException("Unable to convert InputStream to byte[]. " + "Error while reading from Stream.", e); } }  }
InputStreamToByteArrayConverter implements ContentTypeConverter<InputStream, byte[]> { @Override public byte[] convert(InputStream original) { try { return bytesFrom(original); } catch (IOException e) { throw new CannotConvertBetweenTypesException("Unable to convert InputStream to byte[]. " + "Error while reading from Stream.", e); } }  @Override Class<InputStream> expectedSourceType(); @Override Class<byte[]> targetType(); @Override byte[] convert(InputStream original); }
InputStreamToByteArrayConverter implements ContentTypeConverter<InputStream, byte[]> { @Override public byte[] convert(InputStream original) { try { return bytesFrom(original); } catch (IOException e) { throw new CannotConvertBetweenTypesException("Unable to convert InputStream to byte[]. " + "Error while reading from Stream.", e); } }  @Override Class<InputStream> expectedSourceType(); @Override Class<byte[]> targetType(); @Override byte[] convert(InputStream original);  }