sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionStream.html
com.tencent.sonic.sdk
java.lang.Object
所有已实现的接口:java.io.Closeable, java.lang.AutoCloseable
public classSonicSessionStreamextends java.io.InputStream
A SonicSessionStream obtains input bytes from a memStream and a netStream. memStreamis read data from network, netStreamis unread data from network.
嵌套类 | 限定符和类型 | 类和说明 |
| --- | --- |
| static interface | SonicSessionStream.Callback
When SonicSessionStream close the stream will invoke the Callback
|
构造器 | 构造器和说明 |
| --- |
| SonicSessionStream(SonicSessionStream.Callback callback, java.io.ByteArrayOutputStream outputStream, java.io.BufferedInputStream netStream)
Constructor
|
所有方法 实例方法 具体方法 | 限定符和类型 | 方法和说明 |
| --- | --- |
| void | close()
Closes this input stream and releases any system resources associated with the stream and invoke the callback's onClose method
|
| int | read()
Reads a single byte from this stream and returns it as an integer in the range from 0 to 255.
|
| int | read(byte[] buffer)
Reads a byte of data from this input stream Equivalent to read(buffer, 0, buffer.length).
|
| int | read(byte[] buffer, int byteOffset, int byteCount)
Reads up to byteCount bytes from this stream and stores them in the byte array buffer starting at byteOffset.
|
-
available, mark, markSupported, reset, skip
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public SonicSessionStream([SonicSessionStream.Callback](../../../../com/tencent/sonic/sdk/SonicSessionStream.Callback.html "com.tencent.sonic.sdk中的接口")callback,
java.io.ByteArrayOutputStream outputStream,
java.io.BufferedInputStream netStream)
Constructor
参数:callback - CallbackoutputStream - Read data from networknetStream - Unread data from network
-
public void close()
throws java.io.IOException
Closes this input stream and releases any system resources associated with the stream and invoke the callback's onClose method
指定者:close 在接口中 java.io.Closeable指定者:close 在接口中 java.lang.AutoCloseable覆盖:close 在类中 java.io.InputStream抛出:java.io.IOException
-
public int read()
throws java.io.IOException
Reads a single byte from this stream and returns it as an integer in the range from 0 to 255. Returns -1 if the end of the stream has been reached. Blocks until one byte has been read, the end of the source stream is detected or an exception is thrown.
指定者:read 在类中 java.io.InputStream抛出:java.io.IOException - if the stream is closed or another IOException occurs.
-
public int read(@NonNull
byte[] buffer)
throws java.io.IOException
Reads a byte of data from this input stream Equivalent to read(buffer, 0, buffer.length).
覆盖:read 在类中 java.io.InputStream抛出:java.io.IOException
-
public int read(@NonNull
byte[] buffer,
int byteOffset,
int byteCount)
throws java.io.IOException
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.
覆盖:read 在类中 java.io.InputStream抛出:java.lang.IndexOutOfBoundsException - if byteOffset < 0 || byteCount < 0 || byteOffset + byteCount > buffer.length.java.io.IOException - if the stream is closed or another IOException occurs.