@Override
    public long length() {
        final byte[] byteArray = this.arrayRef.get();
        return byteArray != null ? byteArray.length : -1;
    }
Cache resource backed by a byte array on the heap.

@since 4.1
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/HeapResource.java