org.apache.hc.client5.http.impl.cache

## Class ByteArrayCacheEntrySerializer

- java.lang.Object
- - org.apache.hc.client5.http.impl.cache.ByteArrayCacheEntrySerializer

- All Implemented Interfaces:
    HttpCacheEntrySerializer<byte[]>

      @Contract(threading=STATELESS)
      public final class ByteArrayCacheEntrySerializer
      extends Object
      implements HttpCacheEntrySerializer<byte[]>

  `HttpCacheEntrySerializer` implementation that uses the default (native) serialization.
  Since:
    4.1
  See Also:
    `Serializable`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ByteArrayCacheEntrySerializer` | `INSTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ByteArrayCacheEntrySerializer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `HttpCacheStorageEntry` | `deserialize(byte[] serializedObject)` Deserializes a cache entry from its serialized representation.
    `byte[]` | `serialize(HttpCacheStorageEntry cacheEntry)` Serializes the given entry.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final ByteArrayCacheEntrySerializer INSTANCE

  - ### Constructor Detail

    - #### ByteArrayCacheEntrySerializer

          public ByteArrayCacheEntrySerializer()

  - ### Method Detail

    - #### serialize

          public byte[] serialize(HttpCacheStorageEntry cacheEntry)
                           throws ResourceIOException

      Description copied from interface: `HttpCacheEntrySerializer`
      Serializes the given entry.
      Specified by:
        `serialize` in interface `HttpCacheEntrySerializer<byte[]>`
      Parameters:
        `cacheEntry` - cache entry
      Returns:
        serialized representation of the cache entry
      Throws:
        `ResourceIOException`

    - #### deserialize

          public HttpCacheStorageEntry deserialize(byte[] serializedObject)
                                            throws ResourceIOException

      Description copied from interface: `HttpCacheEntrySerializer`
      Deserializes a cache entry from its serialized representation.
      Specified by:
        `deserialize` in interface `HttpCacheEntrySerializer<byte[]>`
      Parameters:
        `serializedObject` - serialized representation of the cache entry
      Returns:
        cache entry
      Throws:
        `ResourceIOException`

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.