1 Change Log 2 ========== 3 4 ## Version 1.6.0 5 6 _2015-08-25_ 7 8 * New: `BufferedSource.indexOf(ByteString)` searches a source for the next 9 occurrence of a byte string. 10 * Fix: Recover from unexpected `AssertionError` thrown on Android 4.2.2 and 11 earlier when asynchronously closing a socket. 12 13 ## Version 1.5.0 14 15 _2015-06-19_ 16 17 * Sockets streams now throw `SocketTimeoutException`. This builds on new 18 extension point in `AsyncTimeout` to customize the exception when a timeout 19 occurs. 20 * New: `ByteString` now implements `Comparable`. The comparison sorts bytes as 21 unsigned: {@code ff} sorts after {@code 00}. 22 23 ## Version 1.4.0 24 25 _2015-05-16_ 26 27 * **Timeout exception changed.** Previously `Timeout.throwIfReached()` would 28 throw `InterruptedIOException` on thread interruption, and `IOException` if 29 the deadline was reached. Now it throws `InterruptedIOException` in both 30 cases. 31 * Fix: throw `EOFException` when attempting to read digits from an empty 32 source. Previously this would crash with an unchecked exception. 33 * New: APIs to read and write UTF-8 code points without allocating strings. 34 * New: `BufferedSink` can now write substrings directly, potentially saving an 35 allocation for some callers. 36 * New: `ForwardingTimeout` class. 37 38 ## Version 1.3.0 39 40 _2015-03-16_ 41 42 * New: Read and write signed decimal and unsigned hexadecimal values in 43 `BufferedSource` and `BufferedSink`. Unlike the alternatives, these methods 44 dont do any memory allocations! 45 * New: Segment sharing. This improves the runtime of operations like 46 `Buffer.clone()` and `Buffer.copyTo()` by sharing underlying segments between 47 buffers. 48 * New: `Buffer.snapshot()` returns an immutable snapshot of a buffer as a 49 `ByteString`. This builds on segment sharing so that snapshots are shallow, 50 immutable copies. 51 * New: `ByteString.rangeEquals()`. 52 * New: `ByteString.md5()` and `ByteString.sha256()`. 53 * New: `ByteString.base64Url()` returns URL-safe Base64. The existing 54 decoding method has been extended to support URL-safe Base64 input. 55 * New: `ByteString.substring()` returns a prefix, infix, or suffix. 56 * New: `Sink` now implements `java.io.Flushable`. 57 * Fix: `Buffer.write(Source, long)` now always writes fully. The previous 58 behavior would return as soon as any data had been written; this was 59 inconsistent with all other _write()_ methods in the API. 60 * Fix: don't leak empty segments in DeflaterSink and InflaterSource. (This was 61 unlikely to cause problems in practice.) 62 63 ## Version 1.2.0 64 65 _2014-12-30_ 66 67 * Fix: `Okio.buffer()` _always_ buffers for better predictability. 68 * Fix: Provide context when `readUtf8LineStrict()` throws. 69 * Fix: Buffers do not call through the `Source` on zero-byte writes. 70 71 ## Version 1.1.0 72 73 _2014-12-11_ 74 75 * Do UTF-8 encoding natively for a performance increase, particularly on Android. 76 * New APIs: `BufferedSink.emit()`, `BufferedSource.request()` and `BufferedSink.indexOfElement()`. 77 * Fixed a performance bug in `Buffer.indexOf()` 78 79 ## Version 1.0.1 80 81 _2014-08-08_ 82 83 * Added `read(byte[])`, `read(byte[], offset, byteCount)`, and 84 `void readFully(byte[])` to `BufferedSource`. 85 * Refined declared checked exceptions on `Buffer` methods. 86 87 88 ## Version 1.0.0 89 90 _2014-05-23_ 91 92 * Bumped release version. No other changes! 93 94 ## Version 0.9.0 95 96 _2014-05-03_ 97 98 * Use 0 as a sentinel for no timeout. 99 * Make AsyncTimeout public. 100 * Remove checked exception from Buffer.readByteArray. 101 102 ## Version 0.8.0 103 104 _2014-04-24_ 105 106 * Eagerly verify preconditions on public APIs. 107 * Quick return on Buffer instance equivalence. 108 * Add delegate types for Sink and Source. 109 * Small changes to the way deadlines are managed. 110 * Add append variant of Okio.sink for File. 111 * Methods to exhaust BufferedSource to byte[] and ByteString. 112 113 ## Version 0.7.0 114 115 _2014-04-18_ 116 117 * Don't use getters in timeout. 118 * Use the watchdog to interrupt sockets that have reached deadlines. 119 * Add java.io and java.nio file source/sink helpers. 120 121 ## Version 0.6.1 122 123 _2014-04-17_ 124 125 * Methods to read a buffered source fully in UTF-8 or supplied charset. 126 * API to read a byte[] directly. 127 * New methods to move all data from a source to a sink. 128 * Fix a bug on input stream exhaustion. 129 130 ## Version 0.6.0 131 132 _2014-04-15_ 133 134 * Make ByteString serializable. 135 * New API: `ByteString.of(byte[] data, int offset, int byteCount)` 136 * New API: stream-based copy, write, and read helpers. 137 138 ## Version 0.5.0 139 140 _2014-04-08_ 141 142 * Initial public release. 143 * Imported from OkHttp. 144