|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.rmi.value.BinaryValue
public class BinaryValue
The BinaryValue class implements the committed value state for
Binary values as a part of the State design pattern (Gof) used by this
package.
NOTE: This class forwards the InputStream from which it was
created through the getStream() method but does not close the
stream. It is the sole responsibility of the user of this value to close the
stream if not needed anymore to prevent memory loss.
This class implements readObject(ObjectInputStream) and
writeObject(ObjectOutputStream) methods to (de-)serialize the
data.
SerialValue,
Serialized Form| Constructor Summary | |
|---|---|
protected |
BinaryValue(java.io.InputStream stream)
Creates an instance on the given InputStream. |
protected |
BinaryValue(java.lang.String value)
Creates an instance providing the UTF-8 representation of the given string value. |
| Method Summary | |
|---|---|
boolean |
getBoolean()
Always throws IllegalStateException because only an
InputStream is available from this implementation. |
java.util.Calendar |
getDate()
Always throws IllegalStateException because only an
InputStream is available from this implementation. |
double |
getDouble()
Always throws IllegalStateException because only an
InputStream is available from this implementation. |
long |
getLong()
Always throws IllegalStateException because only an
InputStream is available from this implementation. |
java.io.InputStream |
getStream()
Returns the InputStream from which this instance has been
created. |
java.lang.String |
getString()
Always throws IllegalStateException because only an
InputStream is available from this implementation. |
int |
getType()
Returns PropertyType.BINARY. |
protected static java.io.InputStream |
toStream(java.lang.String value)
Helper method to convert a string value into an InputStream
from which the UTF-8 representation can be read. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected BinaryValue(java.io.InputStream stream)
InputStream. This exact
stream will be provided by the getStream(), thus care must be
taken to not inadvertendly read or close the stream.
stream - The InputStream providing the value.
protected BinaryValue(java.lang.String value)
throws javax.jcr.ValueFormatException
value - The string whose UTF-8 representation is provided as the
value of this instance.
javax.jcr.ValueFormatException - If the platform does not support UTF-8
encoding (which is unlikely as UTF-8 is required to be available
on all platforms).| Method Detail |
|---|
protected static java.io.InputStream toStream(java.lang.String value)
throws javax.jcr.ValueFormatException
InputStream
from which the UTF-8 representation can be read.
value - The string value to be made available through a stream.
InputStream from which the UTF-8 representation
of the value may be read.
javax.jcr.ValueFormatException - If the platform does not support UTF-8
encoding (which is unlikely as UTF-8 is required to be available
on all platforms).public java.io.InputStream getStream()
InputStream from which this instance has been
created.
getStream in interface javax.jcr.Valuepublic int getType()
PropertyType.BINARY.
getType in interface javax.jcr.Value
public java.lang.String getString()
throws java.lang.IllegalStateException
IllegalStateException because only an
InputStream is available from this implementation.
getString in interface javax.jcr.Valuejava.lang.IllegalStateException - as defined above.
public long getLong()
throws java.lang.IllegalStateException
IllegalStateException because only an
InputStream is available from this implementation.
getLong in interface javax.jcr.Valuejava.lang.IllegalStateException - as defined above.
public double getDouble()
throws java.lang.IllegalStateException
IllegalStateException because only an
InputStream is available from this implementation.
getDouble in interface javax.jcr.Valuejava.lang.IllegalStateException - as defined above.
public java.util.Calendar getDate()
throws java.lang.IllegalStateException
IllegalStateException because only an
InputStream is available from this implementation.
getDate in interface javax.jcr.Valuejava.lang.IllegalStateException - as defined above.
public boolean getBoolean()
throws java.lang.IllegalStateException
IllegalStateException because only an
InputStream is available from this implementation.
getBoolean in interface javax.jcr.Valuejava.lang.IllegalStateException - as defined above.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||