Back to Vassonic

SonicSessionStream (sdk 3.0.0 API)

sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicSessionStream.html

3.1.16.0 KB
Original Source

跳过导航链接

com.tencent.sonic.sdk

类 SonicSessionStream

  • java.lang.Object

    • java.io.InputStream
      • com.tencent.sonic.sdk.SonicSessionStream
  • 所有已实现的接口: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. |

- 

从类继承的方法 java.io.InputStream

available, mark, markSupported, reset, skip

- 

从类继承的方法 java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

构造器详细资料

- 

SonicSessionStream

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

方法详细资料

- 

close

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

- 

read

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.

- 

read

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

- 

read

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.

跳过导航链接