METHOD_0 ( ) { System . out . println ( STRING_0 ) ; IDENT_0 . IDENT_1 . IDENT_2 . IDENT_3 IDENT_4 = new IDENT_0 . IDENT_1 . IDENT_2 . METHOD_1 ( ) ; IDENT_4 . METHOD_2 ( java . nio . ByteBuffer . METHOD_3 ( "test" . getBytes ( ) ) ) ; org . apache . IDENT_5 . IDENT_6 . IDENT_7 res = new org . apache . IDENT_5 . IDENT_6 . METHOD_4 ( ) ; res . METHOD_5 ( ) ; byte [ ] expResult = "test" . getBytes ( ) ; byte [ ] result = instance . METHOD_6 ( IDENT_4 , res ) ; "<AssertPlaceHolder>" ; } METHOD_6 ( java . nio . IDENT_8 . IDENT_9 , org . apache . IDENT_5 . IDENT_6 . METHOD_4 ) { java . io . ByteArrayOutputStream response = new java . io . ByteArrayOutputStream ( ) ; java . nio . ByteBuffer IDENT_10 = METHOD_7 ( ) ; IDENT_10 . METHOD_8 ( ) ; boolean IDENT_11 = true ; int IDENT_12 ; int IDENT_13 = 0 ; if ( IDENT_0 . IDENT_1 . IDENT_5 . IDENT_6 . IDENT_14 . log . METHOD_9 ( ) ) { IDENT_0 . IDENT_1 . IDENT_5 . IDENT_6 . IDENT_14 . log . debug ( STRING_1 ) ; } try { while ( ( IDENT_12 = channel . read ( IDENT_10 ) ) != ( - 1 ) ) { IDENT_13 += IDENT_12 ; if ( IDENT_11 ) { res . METHOD_10 ( ) ; IDENT_11 = false ; } IDENT_10 . METHOD_11 ( ) ; if ( ( response . size ( ) ) <= ( IDENT_15 ) ) { byte [ ] bytes = new byte [ IDENT_12 ] ; IDENT_10 . get ( bytes ) ; response . write ( bytes ) ; } IDENT_10 . METHOD_8 ( ) ; } if ( ( response . size ( ) ) < 1 ) { IDENT_0 . IDENT_1 . IDENT_5 . IDENT_6 . IDENT_14 . log . warn ( STRING_2 ) ; channel . close ( ) ; } } catch ( java . io . IOException ex ) { channel . close ( ) ; throw ex ; } if ( IDENT_0 . IDENT_1 . IDENT_5 . IDENT_6 . IDENT_14 . log . METHOD_9 ( ) ) { IDENT_0 . IDENT_1 . IDENT_5 . IDENT_6 . IDENT_14 . log . debug ( STRING_3 ) ; } res . METHOD_12 ( ) ; if ( ! ( METHOD_13 ( ) ) ) { channel . close ( ) ; } res . METHOD_14 ( IDENT_13 ) ; return response . toByteArray ( ) ; }
org . junit . Assert . assertEquals ( expResult . length , result . length )