title: okio.Base64.encode ArrayIndexOutOfBoundsException why is that even happening?
body: <p>I noticed such exception in fabric, which is occurring rarely but with every build, 3-5 crashes every week on 2-3 users (from ~500 DAU)
  I didn't found any information about such crashes, does anyone knows what causes them? </p>
  
  <p>I've found only one question about such issue but it was deleted as "duplicate" <a href="https://stackoverflow.com/questions/45868217/arrayindexoutofboundsexception-trying-to-cache-certificate-list-in-okhttp3">https://stackoverflow.com/questions/45868217/arrayindexoutofboundsexception-trying-to-cache-certificate-list-in-okhttp3</a></p>
  
  <pre><code>Fatal Exception: java.lang.ArrayIndexOutOfBoundsException
  length=1305; index=1953974520
  
  okio.Base64.encode (Base64.java:137)
  okio.Base64.encode (Base64.java:125)
  okio.ByteString.base64 (ByteString.java:105)
  okhttp3.Cache$Entry.writeCertList (Cache.java:686)
  okhttp3.Cache$Entry.writeTo (Cache.java:645)
  okhttp3.Cache.put (Cache.java:249)
  okhttp3.Cache.access$000 (Cache.java:136)
  okhttp3.Cache$1.put (Cache.java:148)
  okhttp3.internal.cache.CacheInterceptor.maybeCache (CacheInterceptor.java:173)
  okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.java:143)
  okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:92)
  okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:67)
  okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.java:93)
  okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:92)
  okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.java:124)
  okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:92)
  okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:67)
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p><a href="https://github.com/square/okio/issues/325" rel="nofollow noreferrer">https://github.com/square/okio/issues/325</a> Okio ticket for this issue
  <a href="https://issuetracker.google.com/issues/69364976" rel="nofollow noreferrer">https://issuetracker.google.com/issues/69364976</a> Google ticket for this issue</p>
  
  <p><strong>UPDATE 2:</strong>
  was fixed in Android Studio 3.1 Canary 6 Build</p>