For IntelliJ IDEA,
Android Studio or Eclipse



/** * Sets the delegate of {@code timeout} to {@link Timeout#NONE} and resets its underlying timeout * to the default configuration. Use this to avoid unexpected sharing of timeouts between pooled * connections. */ void detachTimeout(ForwardingTimeout timeout) { Timeout oldDelegate = timeout.delegate(); timeout.setDelegate(Timeout.NONE); oldDelegate.clearDeadline(); oldDelegate.clearTimeout(); }
/** Append space-prefixed lengths to {@code writer}. */ void writeLengths(BufferedSink writer) throws IOException { for (long length : lengths) { writer.writeByte(' ').writeDecimalLong(length); } }
public static String basic(String username, String password, Charset charset) { String usernameAndPassword = username + ":" + password; String encoded = ByteString.encodeString(usernameAndPassword, charset).base64(); return "Basic " + encoded; } }
/** Waits for an OAuth session for this client to be set. */ public synchronized void awaitAccessToken(Timeout timeout) throws InterruptedIOException { while (session == null) { timeout.waitUntilNotified(this); } }
@Override public boolean onData(int streamId, BufferedSource source, int byteCount, boolean last) throws IOException { source.skip(byteCount); return true; }
Reader(int headerTableSizeSetting, int maxDynamicTableByteCount, Source source) { this.headerTableSizeSetting = headerTableSizeSetting; this.maxDynamicTableByteCount = maxDynamicTableByteCount; this.source = Okio.buffer(source); }