public class DurboValue
extends java.lang.Object
DurboValue implements an internal representation of a value
retrieved from the DurboInput. It is either based on bytes or on a stream.| Constructor and Description |
|---|
DurboValue(int type,
byte[] bytes)
Creates a new value that is based on a byte array
|
DurboValue(int type,
java.io.InputStream in,
long size)
Creates a new value that is based on a stream
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes()
Returns a byte representation of this value.
|
double |
getDouble()
Returns a double representation of this value.
|
long |
getLength()
Returns the size of this value
|
int |
getSize()
Deprecated.
since 2.1.2 use
getLength() instead. |
java.io.InputStream |
getStream()
Returns a stream representation of this value.
|
java.lang.String |
getString()
Returns a string representation of this value.
|
int |
getType()
Returns the property type of this value.
|
boolean |
isByteArrayBased()
Checks if this value internally is based on a byte array.
|
Value |
toJcrValue(ValueFactory factory)
Returns a new jcr value from this value using the value type.
|
public DurboValue(int type,
byte[] bytes)
type - the property typebytes - the byte arrayPropertyTypepublic DurboValue(int type,
java.io.InputStream in,
long size)
type - the property typein - the input streamsize - the size of the data in the input streamPropertyTypepublic int getType()
PropertyTypepublic int getSize()
getLength() instead.public long getLength()
public byte[] getBytes()
throws java.io.IOException
java.io.IOException - if an I/O error during spooling occurs.public java.lang.String getString()
throws java.io.IOException
getBytes() are converted in a string using utf-8 as encoding.java.io.IOException - if an I/O error during conversion occurs.public double getDouble()
throws java.io.IOException
getString() is converted to a double using
Double.parseDouble(String).java.io.IOException - if an i/O error during conversion occurs.public java.io.InputStream getStream()
ByteArrayInputStream of the internal byte array is returned.public boolean isByteArrayBased()
true if this value is based on a byte array;
false otherwise.public Value toJcrValue(ValueFactory factory)
throws java.io.IOException,
RepositoryException
PropertyType#BINARY the new value is
created using getStream(), otherwise the new value is
created using getString().factory - the value factory that is used to create the valuejava.io.IOException - if an I/O error occurs.RepositoryException - if a repository error occurs."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"