Class ArrayBackedBinaryStream
java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
org.hibernate.engine.jdbc.internal.ArrayBackedBinaryStream
- All Implemented Interfaces:
Closeable,AutoCloseable,BinaryStream
Implementation of
BinaryStream backed by a byte[] array.-
Field Summary
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasBlob(LobCreator lobCreator) Use the givenLobCreatorto create aBlobwith the same data as this binary stream.byte[]getBytes()Access to the bytes.Retrieve the input stream.longRetrieve the length of the input streamvoidrelease()Release any underlying resources.Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferToMethods inherited from class java.io.InputStream
nullInputStream, read, readNBytes, skipNBytes
-
Constructor Details
-
ArrayBackedBinaryStream
public ArrayBackedBinaryStream(byte[] bytes) Constructs a ArrayBackedBinaryStream- Parameters:
bytes- The bytes to use backing the stream
-
-
Method Details
-
getInputStream
Description copied from interface:BinaryStreamRetrieve the input stream.- Specified by:
getInputStreamin interfaceBinaryStream- Returns:
- The input stream
-
getBytes
public byte[] getBytes()Description copied from interface:BinaryStreamAccess to the bytes.- Specified by:
getBytesin interfaceBinaryStream- Returns:
- The bytes.
-
getLength
public long getLength()Description copied from interface:BinaryStreamRetrieve the length of the input stream- Specified by:
getLengthin interfaceBinaryStream- Returns:
- The input stream length
-
asBlob
Description copied from interface:BinaryStreamUse the givenLobCreatorto create aBlobwith the same data as this binary stream.- Specified by:
asBlobin interfaceBinaryStream
-
release
public void release()Description copied from interface:BinaryStreamRelease any underlying resources.- Specified by:
releasein interfaceBinaryStream
-