@ Override public int read ( byte b [ ] , int off , int len ) throws IOException { int leftover = buf_end - buf_pos ; if ( len <= leftover ) { System . arraycopy ( buffer , buf_pos , b , off , len ) ; buf_pos += len ; return len ; } for ( int i = 0 ; i < len ; i ++ ) { int c = this . read ( ) ; if ( c != - 1 ) { b [ off + i ] = ( byte ) c ; } else { return i ; } } return len ; }
Reads the set number of bytes into the passed buffer .