public synchronized int get ( ) { if ( available == 0 ) { return - 1 ; } byte value = buffer [ idxGet ] ; idxGet = ( idxGet + 1 ) % capacity ; available -- ; return value ; }
Gets a single byte return or - 1 if no data is available .