public class InlineByteArrayReference extends AbstractExternalReference implements ValueCarryingExternalReference<byte[]>
Unfortunately this does break things (binaries get corrupted) so I've added base64 encoding of the value as a workaround.
Constructor and Description |
---|
InlineByteArrayReference() |
Modifier and Type | Method and Description |
---|---|
InlineByteArrayReference |
clone() |
Long |
getApproximateSizeInBytes()
Approximate size of the stored data or -1 if we do not know.
|
String |
getContents() |
byte[] |
getValue()
Returns the value
|
Class<byte[]> |
getValueType()
Returns the type of the inlined value
|
InputStream |
openStream(ReferenceContext context)
Open and return an InputStream to the data referenced using, if required,
any facilities within the supplied context.
|
void |
setContents(String contentsAsString) |
void |
setValue(byte[] newBytes) |
getCharset, getDataNature, getPrimaryKey, getResolutionCost, setPrimaryKey
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCharset, getDataNature, getResolutionCost
public void setValue(byte[] newBytes)
public byte[] getValue()
ValueCarryingExternalReference
getValue
in interface ValueCarryingExternalReference<byte[]>
public Class<byte[]> getValueType()
ValueCarryingExternalReference
getValueType
in interface ValueCarryingExternalReference<byte[]>
public InputStream openStream(ReferenceContext context) throws DereferenceException
ExternalReferenceSPI
openStream
in interface ExternalReferenceSPI
context
- the ReferenceContext object used to obtain e.g. security
agents or other facilities required when de-referencing this
reference.DereferenceException
- if the reference cannot be de-referenced. This may be because
of problems with the context such as security failures, or it
may be because the reference is inherently not possible to
de-reference (as in the case of a non-serializable API
consumer reference).public String getContents()
public void setContents(String contentsAsString)
public Long getApproximateSizeInBytes()
ExternalReferenceSPI
getApproximateSizeInBytes
in interface ExternalReferenceSPI
public InlineByteArrayReference clone()
clone
in interface ExternalReferenceSPI
clone
in class AbstractExternalReference
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.