private void appendEntity ( OutputStream outputStream , ByteArrayInputStream byteArrayInputStream ) { try { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; while ( true ) { int bytesRead = byteArrayInputStream . read ( buffer ) ; if ( bytesRead <= 0 ) { break ; } outputStream . write ( buffer , 0 , bytesRead ) ; } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Append entity .