@Experimental public class HttpByteArrayCacheEntrySerializer extends Object implements HttpCacheEntrySerializer<byte[]>
Modifier and Type | Field and Description |
---|---|
static HttpByteArrayCacheEntrySerializer |
INSTANCE |
Constructor and Description |
---|
HttpByteArrayCacheEntrySerializer() |
Modifier and Type | Method and Description |
---|---|
HttpCacheStorageEntry |
deserialize(byte[] serializedObject)
Deserializes a cache entry from its serialized representation.
|
protected InputStream |
makeByteArrayInputStream(byte[] bytes)
Helper method to make a new ByteArrayInputStream.
|
protected org.apache.hc.core5.http.impl.io.AbstractMessageParser<org.apache.hc.core5.http.ClassicHttpResponse> |
makeHttpResponseParser()
Helper method to make a new HTTP Response parser.
|
protected org.apache.hc.core5.http.impl.io.AbstractMessageWriter<SimpleHttpResponse> |
makeHttpResponseWriter(org.apache.hc.core5.http.io.SessionOutputBuffer outputBuffer)
Helper method to make a new HTTP response writer.
|
byte[] |
serialize(HttpCacheStorageEntry httpCacheEntry)
Serializes the given entry.
|
public static final HttpByteArrayCacheEntrySerializer INSTANCE
public byte[] serialize(HttpCacheStorageEntry httpCacheEntry) throws ResourceIOException
HttpCacheEntrySerializer
serialize
in interface HttpCacheEntrySerializer<byte[]>
httpCacheEntry
- cache entryResourceIOException
public HttpCacheStorageEntry deserialize(byte[] serializedObject) throws ResourceIOException
HttpCacheEntrySerializer
deserialize
in interface HttpCacheEntrySerializer<byte[]>
serializedObject
- serialized representation of the cache entryResourceIOException
protected org.apache.hc.core5.http.impl.io.AbstractMessageWriter<SimpleHttpResponse> makeHttpResponseWriter(org.apache.hc.core5.http.io.SessionOutputBuffer outputBuffer)
Useful to override for testing.
outputBuffer
- Output buffer to write toprotected InputStream makeByteArrayInputStream(byte[] bytes)
Useful to override for testing.
bytes
- Bytes to read from the streamprotected org.apache.hc.core5.http.impl.io.AbstractMessageParser<org.apache.hc.core5.http.ClassicHttpResponse> makeHttpResponseParser()
Useful to override for testing.
Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.