@Test public void testToBytes() throws Exception { Assert.assertNotNull(new String(InputStreamTransforms.TRANSFORMER.toBytes(newInputStream("12345")))); }
@Transformer public byte[] toBytes(InputStream inStream) { ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream(); try { byte[] readBuffer = new byte[56]; int readCount; while ((readCount = inStream.read(readBuffer)) != -1) { byteBuffer.write(readBuffer, 0, readCount); } } catch (IOException e) { LOGGER.debug("Error reading from InputStream.", e); } finally { try { inStream.close(); } catch (IOException e) { LOGGER.debug("Failed to close InputStream instance.", e); } } return byteBuffer.toByteArray(); }
InputStreamTransforms { @Transformer public byte[] toBytes(InputStream inStream) { ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream(); try { byte[] readBuffer = new byte[56]; int readCount; while ((readCount = inStream.read(readBuffer)) != -1) { byteBuffer.write(readBuffer, 0, readCount); } } catch (IOException e) { LOGGER.debug("Error reading from InputStream.", e); } finally { try { inStream.close(); } catch (IOException e) { LOGGER.debug("Failed to close InputStream instance.", e); } } return byteBuffer.toByteArray(); } }
InputStreamTransforms { @Transformer public byte[] toBytes(InputStream inStream) { ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream(); try { byte[] readBuffer = new byte[56]; int readCount; while ((readCount = inStream.read(readBuffer)) != -1) { byteBuffer.write(readBuffer, 0, readCount); } } catch (IOException e) { LOGGER.debug("Error reading from InputStream.", e); } finally { try { inStream.close(); } catch (IOException e) { LOGGER.debug("Failed to close InputStream instance.", e); } } return byteBuffer.toByteArray(); }  }
InputStreamTransforms { @Transformer public byte[] toBytes(InputStream inStream) { ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream(); try { byte[] readBuffer = new byte[56]; int readCount; while ((readCount = inStream.read(readBuffer)) != -1) { byteBuffer.write(readBuffer, 0, readCount); } } catch (IOException e) { LOGGER.debug("Error reading from InputStream.", e); } finally { try { inStream.close(); } catch (IOException e) { LOGGER.debug("Failed to close InputStream instance.", e); } } return byteBuffer.toByteArray(); }  @Transformer String toString(InputStream inStream); @Transformer Reader toReader(InputStream inStream); @Transformer InputSource toInputSource(InputStream inStream); @Transformer Integer toInteger(InputStream inStream); @Transformer Long toLong(InputStream inStream); @Transformer Short toShort(InputStream inStream); @Transformer char[] toChars(InputStream inStream); @Transformer Character toCharacter(InputStream inStream); @Transformer byte[] toBytes(InputStream inStream); @Transformer Double toDouble(InputStream inStream); @Transformer Float toFloat(InputStream inStream); }
InputStreamTransforms { @Transformer public byte[] toBytes(InputStream inStream) { ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream(); try { byte[] readBuffer = new byte[56]; int readCount; while ((readCount = inStream.read(readBuffer)) != -1) { byteBuffer.write(readBuffer, 0, readCount); } } catch (IOException e) { LOGGER.debug("Error reading from InputStream.", e); } finally { try { inStream.close(); } catch (IOException e) { LOGGER.debug("Failed to close InputStream instance.", e); } } return byteBuffer.toByteArray(); }  @Transformer String toString(InputStream inStream); @Transformer Reader toReader(InputStream inStream); @Transformer InputSource toInputSource(InputStream inStream); @Transformer Integer toInteger(InputStream inStream); @Transformer Long toLong(InputStream inStream); @Transformer Short toShort(InputStream inStream); @Transformer char[] toChars(InputStream inStream); @Transformer Character toCharacter(InputStream inStream); @Transformer byte[] toBytes(InputStream inStream); @Transformer Double toDouble(InputStream inStream); @Transformer Float toFloat(InputStream inStream); static final InputStreamTransforms TRANSFORMER; }