Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api.impl.blob
Class StreamBlob

java.lang.Object
  extended by org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
      extended by org.nuxeo.ecm.core.api.impl.blob.StreamBlob
All Implemented Interfaces:
Blob
Direct Known Subclasses:
DefaultStreamBlob

public abstract class StreamBlob
extends AbstractBlob

Author:
Bogdan Stefanescu

Field Summary
 
Fields inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
EMPTY_BYTE_ARRAY, EMPTY_INPUT_STREAM, EMPTY_READER, EMPTY_STRING
 
Constructor Summary
StreamBlob()
           
 
Method Summary
 ByteArrayBlob asByteArrayBlob()
           
 StringBlob asStringBlob()
           
 byte[] getByteArray()
           
 long getLength()
          Gets the data length in bytes if known.
 Reader getReader()
           
 String getString()
           
static byte[] readBytes(InputStream in)
           
static byte[] readBytes(Reader reader)
           
static String readString(Reader reader)
           
 
Methods inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
copy, copy, transferTo, transferTo, transferTo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nuxeo.ecm.core.api.Blob
getDigest, getEncoding, getFilename, getMimeType, getStream, isPersistent, persist, setDigest, setEncoding, setFilename, setMimeType
 

Constructor Detail

StreamBlob

public StreamBlob()
Method Detail

readBytes

public static byte[] readBytes(InputStream in)
                        throws IOException
Throws:
IOException

readBytes

public static byte[] readBytes(Reader reader)
                        throws IOException
Throws:
IOException

readString

public static String readString(Reader reader)
                         throws IOException
Throws:
IOException

getByteArray

public byte[] getByteArray()
                    throws IOException
Throws:
IOException

getString

public String getString()
                 throws IOException
Throws:
IOException

getReader

public Reader getReader()
                 throws IOException
Throws:
IOException

getLength

public long getLength()
Description copied from interface: Blob
Gets the data length in bytes if known.

Returns:
the data length or -1 if not known

asByteArrayBlob

public ByteArrayBlob asByteArrayBlob()
                              throws IOException
Throws:
IOException

asStringBlob

public StringBlob asStringBlob()
                        throws IOException
Throws:
IOException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.