com.ibm.streams.operator.types
Interface Blob
-
public interface Blob
SPLblob
, which is a sequence of bytes.ValueFactory
is used as a factory class to create instances of this interface.Instances of
Blob
are immutable and implementjava.io.Serializable
.Note:
toString()
returns this blob value as aString
using the SPL character encoding. The value returned has pairs of hexadecimal characters, one for each byte of the blob. The format is identical to one returned byjavax.xml.bind.DatatypeConverter.printHexBinary(byte[])
.- See Also:
Type.MetaType.BLOB
,Tuple.getBlob(int)
,OutputTuple.setBlob(int, Blob)
,ValueFactory.newBlob(byte[])
,ValueFactory.newBlob(byte[], int, int)
,ValueFactory.newBlob(ByteBuffer, int)
,ValueFactory.readBlob(InputStream)
,ValueFactory.readBlob(InputStream, long)
,ValueFactory.readBlobWithPrefixLength(InputStream)
-
-
Method Summary
Methods Modifier and Type Method and Description java.nio.ByteBuffer
getByteBuffer()
Return a read-only Byte Buffer that represents this complete blob.java.nio.ByteBuffer
getByteBuffer(long position, int length)
Return a read-only Byte Buffer that represents the portion of this blob value defined bbyte[]
getData()
Get a copy of the data for this blob.java.io.InputStream
getInputStream()
Return an InputStream representing the value positioned at the first byte.long
getLength()
Get the number of bytes in this blob.java.nio.ByteBuffer
put(java.nio.ByteBuffer buf)
Put this value into a byte buffer.
-
-
-
Method Detail
-
getLength
long getLength()
Get the number of bytes in this blob.- Returns:
- Number of bytes in this blob
-
getByteBuffer
java.nio.ByteBuffer getByteBuffer()
Return a read-only Byte Buffer that represents this complete blob. If this blob cannot be contained in a single ByteBuffer then an exception is thrown.- Returns:
- A read-only ByteBuffer representing this blob.
-
getByteBuffer
java.nio.ByteBuffer getByteBuffer(long position, int length)
Return a read-only Byte Buffer that represents the portion of this blob value defined b- Parameters:
position
- Position of the first byte to be returned. 0 is the first byte of the blob.length
- Number of bytes in the buffer.- Returns:
- A read-only ByteBuffer representing a portion of this blob.
-
getInputStream
java.io.InputStream getInputStream()
Return an InputStream representing the value positioned at the first byte.- Returns:
- An InputStream to read the value.
-
getData
byte[] getData()
Get a copy of the data for this blob. If this blob cannot be contained in abyte[]
then an exception is thrown.- Returns:
- A copy of the data in this blob.
- Since:
- InfoSphere® Streams Version 4.0
-
put
java.nio.ByteBuffer put(java.nio.ByteBuffer buf)
Put this value into a byte buffer. Will write the data representing this value.- Parameters:
buf
- ByteBuffer to be written into.- Returns:
- The passed in ByteBuffer.
- Since:
- InfoSphere® Streams Version 4.0
-
-