Package org.conscrypt
Class SSLEngineDataStream
java.lang.Object
org.conscrypt.SSLEngineDataStream
- All Implemented Interfaces:
DataStream
public class SSLEngineDataStream extends Object implements DataStream
This class provides the DataStream functionality
implemented over the array of ByteBuffer instances.
Among with the data chunks read functionality
it provides the info about amount of consumed data.
The source ByteBuffer objects can be replaced by other.
So one instance of this wrapper can be reused for several
data sources.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSSLEngineDataStream() -
Method Summary
Modifier and Type Method Description intavailable()protected intconsumed()byte[]getData(int length)Retrieves the data of specified length from the stream.booleanhasData()Checks if there is data to be read.protected voidsetSourceBuffers(ByteBuffer[] srcs, int offset, int length)
-
Constructor Details
-
SSLEngineDataStream
protected SSLEngineDataStream()
-
-
Method Details
-
setSourceBuffers
-
available
public int available() -
hasData
public boolean hasData()Description copied from interface:DataStreamChecks if there is data to be read.- Specified by:
hasDatain interfaceDataStream- Returns:
- true if there is the input data in the stream, false otherwise
-
getData
public byte[] getData(int length)Description copied from interface:DataStreamRetrieves the data of specified length from the stream. If the data size in the stream is less than specified length, method returns all the data contained in the stream.- Specified by:
getDatain interfaceDataStream- Returns:
- byte array containing the demanded data.
-
consumed
protected int consumed()
-