Package org.conscrypt

Class SSLSocketInputStream

java.lang.Object
java.io.InputStream
org.conscrypt.SSLSocketInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public final class SSLSocketInputStream
extends InputStream
This class provides input data stream functionality for SSLSocket. It accumulates the application data received by SSL protocol.
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected org.conscrypt.SSLSocketInputStream.Adapter dataPoint  
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected SSLSocketInputStream​(SSLSocketImpl owner)
    Creates the application data input stream for specified socket.
  • Method Summary

    Modifier and Type Method Description
    int available()
    Returns the number of bytes available for reading without blocking.
    void close()
    Closes the stream
    int read()
    Reads one byte.
    int read​(byte[] b, int off, int len)
    Reads up to byteCount bytes from this stream and stores them in the byte array buffer starting at byteOffset.
    protected void setEnd()
    Tells to the stream that the end of the income data has been reached.

    Methods inherited from class java.io.InputStream

    mark, markSupported, read, reset, skip

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • dataPoint

      protected org.conscrypt.SSLSocketInputStream.Adapter dataPoint
  • Constructor Details

    • SSLSocketInputStream

      protected SSLSocketInputStream​(SSLSocketImpl owner)
      Creates the application data input stream for specified socket.
      Parameters:
      owner - the socket which will provide this input stream to client applications.
  • Method Details

    • setEnd

      protected void setEnd()
      Tells to the stream that the end of the income data has been reached.
    • available

      public int available() throws IOException
      Returns the number of bytes available for reading without blocking.
      Overrides:
      available in class InputStream
      Returns:
      the number of available bytes.
      Throws:
      IOException
    • close

      public void close() throws IOException
      Closes the stream
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class InputStream
      Throws:
      IOException
    • read

      public int read() throws IOException
      Reads one byte. If there is no data in the underlying buffer, this operation can block until the data will be available.
      Specified by:
      read in class InputStream
      Returns:
      read value.
      Throws:
      IOException
    • read

      public int read​(byte[] b, int off, int len) throws IOException
      Description copied from class: InputStream
      Reads up to byteCount bytes from this stream and stores them in the byte array buffer starting at byteOffset. Returns the number of bytes actually read or -1 if the end of the stream has been reached.
      Overrides:
      read in class InputStream
      Throws:
      IOException - if the stream is closed or another IOException occurs.