METHOD_0 ( ) { "<AssertPlaceHolder>" ; } toByteArray ( org . apache . poi . util . InputStream , long , int ) { if ( ( length < 0L ) || ( IDENT_0 < 0L ) ) { throw new org . apache . poi . util . METHOD_1 ( STRING_0 ) ; } if ( length > ( ( long ) ( Integer . MAX_VALUE ) ) ) { throw new org . apache . poi . util . METHOD_1 ( ( STRING_1 + ( Integer . MAX_VALUE ) ) ) ; } org . apache . poi . util . IDENT_1 . METHOD_2 ( length , IDENT_0 ) ; final int len = java . lang . Math . min ( ( ( int ) ( length ) ) , IDENT_0 ) ; org . apache . poi . util . ByteArrayOutputStream IDENT_2 = new org . apache . poi . util . ByteArrayOutputStream ( ( len == ( Integer . MAX_VALUE ) ? INT_0 : len ) ) ; byte [ ] buffer = new byte [ INT_0 ] ; int IDENT_3 = 0 ; int IDENT_4 ; do { IDENT_4 = stream . read ( buffer , 0 , java . lang . Math . min ( buffer . length , ( len - IDENT_3 ) ) ) ; IDENT_3 += java . lang . Math . max ( IDENT_4 , 0 ) ; if ( IDENT_4 > 0 ) { IDENT_2 . write ( buffer , 0 , IDENT_4 ) ; } } while ( ( IDENT_3 < len ) && ( IDENT_4 > ( - 1 ) ) ) ; if ( ( IDENT_0 != ( Integer . MAX_VALUE ) ) && ( IDENT_3 == IDENT_0 ) ) { throw new org . apache . poi . util . IOException ( ( ( STRING_2 + IDENT_0 ) + STRING_3 ) ) ; } if ( ( len != ( Integer . MAX_VALUE ) ) && ( IDENT_3 < len ) ) { throw new org . apache . poi . util . METHOD_3 ( ( ( ( STRING_4 + len ) + STRING_5 ) + IDENT_3 ) ) ; } return IDENT_2 . toByteArray ( ) ; }
org . junit . Assert . assertArrayEquals ( new byte [ ] { 1 , 2 , 3 } , org . apache . poi . util . IDENT_1 . toByteArray ( new java . io . ByteArrayInputStream ( new byte [ ] { 1 , 2 , 3 } ) ) )