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 Details

    • SSLEngineDataStream

      protected SSLEngineDataStream()
  • Method Details

    • setSourceBuffers

      protected void setSourceBuffers​(ByteBuffer[] srcs, int offset, int length)
    • available

      public int available()
    • hasData

      public boolean hasData()
      Description copied from interface: DataStream
      Checks if there is data to be read.
      Specified by:
      hasData in interface DataStream
      Returns:
      true if there is the input data in the stream, false otherwise
    • getData

      public byte[] getData​(int length)
      Description copied from interface: DataStream
      Retrieves 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:
      getData in interface DataStream
      Returns:
      byte array containing the demanded data.
    • consumed

      protected int consumed()