Okio 1.13.0
Jar File
Okio کتابخانه است که مکمل java.io و java.nio می باشد تا دسترسی، ذخیره و پردازش اطلاعات شما را بسیار ساده تر کند. این کتابخانه همچنین یک کامپوننت برای کتابخانه Okhttp می باشد.
ByteStrings and Buffers
Okio is built around two types that pack a lot of capability into a straightforward API:ByteString is an immutable sequence of bytes. For character data, String is fundamental. ByteString is String’s long-lost brother, making it easy to treat binary data as a value. This class is ergonomic: it knows how to encode and decode itself as hex, base64, and UTF-8.
– Buffer is a mutable sequence of bytes. Like ArrayList, you don’t need to size your buffer in advance. You read and write buffers as a queue: write data to the end and read it from the front. There’s no obligation to manage positions, limits, or capacities.
– Internally, ByteString and Buffer do some clever things to save CPU and memory. If you encode a UTF-8 string as a ByteString, it caches a reference to that string so that if you decode it later, there’s no work to do.
Buffer is implemented as a linked list of segments. When you move data from one buffer to another, it reassigns ownership of the segments rather than copying the data across. This approach is particularly helpful for multithreaded programs: a thread that talks to the network can exchange data with a worker thread without any copying or ceremony.
Internally, ByteString and Buffer do some clever things to save CPU and memory. If you encode a UTF-8 string as a ByteString, it caches a reference to that string so that if you decode it later, there’s no work to do.
Buffer is implemented as a linked list of segments. When you move data from one buffer to another, it reassigns ownership of the segments rather than copying the data across. This approach is particularly helpful for multithreaded programs: a thread that talks to the network can exchange data with a worker thread without any copying or ceremony.
پیاده سازی از طریق Repository ها
<dependency> <groupId>com.squareup.okio</groupId> <artifactId>okio</artifactId> <version>1.13.0</version> </dependency>
compile 'com.squareup.okio:okio:1.13.0'
ProGuard
اگر از ProGuard استفاده کنید، باید موارد زیر را در آن اضافه کنید تا این کتابخانه به درستی کار کند.
-dontwarn okio.**
پست های مرتبط با این کتابخانه
به زودی…
نظرات ثبت شده بدون دیدگاه