java.lang.Object
java.io.InputStream
cn.warpin.thirdPart.huawei.obs.obs.services.model.select.SelectInputStream
所有已实现的接口:
Closeable, AutoCloseable

public class SelectInputStream extends InputStream
  • 字段详细资料

    • DEFAULT_MESSAGE_BUFFER_SIZE

      private static final int DEFAULT_MESSAGE_BUFFER_SIZE
      另请参阅:
    • CHUNK_SIZE

      private static final int CHUNK_SIZE
      另请参阅:
    • OCTET_STREAM_TYPE

      private static final String OCTET_STREAM_TYPE
      另请参阅:
    • XML_STREAM_TYPE

      private static final String XML_STREAM_TYPE
      另请参阅:
    • input

      private InputStream input
    • inputChunk

      private byte[] inputChunk
    • messageBuffer

      private ByteBuffer messageBuffer
    • visitor

      private SelectEventVisitor visitor
    • dataBuffer

      private ByteBuffer dataBuffer
    • done

      private boolean done
    • isAborting

      private boolean isAborting
    • totalLength

      private int totalLength
    • headersLength

      private int headersLength
    • next

      private int next
  • 构造器详细资料

    • SelectInputStream

      SelectInputStream(InputStream input, SelectEventVisitor visitor)
      Creates an iterator with an event visitor over a binary input stream
      参数:
      input - Binary input strean
      visitor - Event visitor
    • SelectInputStream

      SelectInputStream(InputStream input)
      Creates an iterator over a binary input stream
      参数:
      input - Binary input strean
      visitor - Event visitor
  • 方法详细资料

    • abort

      public void abort()
      Informs that the serialization process must be aborted. It does not close immediately, just marks it to do it in the next synchronous call
    • read

      public int read() throws IOException
      Returns the next character in the input stream
      指定者:
      read 在类中 InputStream
      返回:
      The next character, or -1 when the input stream is closed or already consumed
      抛出:
      IOException
    • read

      public int read(byte[] b, int off, int len) throws IOException
      Returns an array of characters from the input stream
      覆盖:
      read 在类中 InputStream
      参数:
      b - Output byte array
      off - Offset into the output array
      len - Max number of characters to read
      返回:
      The number of characters returned, or -1 when the input stream is closed or already consumed
      抛出:
      IOException
    • skip

      public long skip(long len) throws IOException
      Skips one or more characters from the input stream
      覆盖:
      skip 在类中 InputStream
      参数:
      len - Number of bytes to skip
      返回:
      Number of bytes skipped
      抛出:
      IOException
    • available

      public int available() throws IOException
      Returns the current number of bytes buffered. It only reports the buffered characters but not the total remaining bytes in the stream because this value is not known in advance.
      覆盖:
      available 在类中 InputStream
      返回:
      Number of buffered bytes, or 0 when the stream is empty
      抛出:
      IOException
    • close

      public void close() throws IOException
      Closes the stream
      指定者:
      close 在接口中 AutoCloseable
      指定者:
      close 在接口中 Closeable
      覆盖:
      close 在类中 InputStream
      抛出:
      IOException
    • mark

      public void mark(int readLimit)
      Marks the current position in the stream NOT SUPPORTED
      覆盖:
      mark 在类中 InputStream
    • reset

      public void reset() throws IOException
      Resets the stream NOT SUPPORTED, it raises an exception
      覆盖:
      reset 在类中 InputStream
      抛出:
      IOException
    • markSupported

      public boolean markSupported()
      Returns if stream marks are supported Default is false because marks are not supported
      覆盖:
      markSupported 在类中 InputStream
    • consume

      private void consume(int len)
      Consumes some bytes from the current buffer.
      参数:
      len - Number of bytes to consume
    • fetch

      private void fetch(int len) throws IOException
      Stores one or more bytes into the input buffer It loads chunks of data and processes the events until there are enough bytes into the input buffer
      参数:
      len - Requested number of bytes to buffer
      抛出:
      IOException
    • processEvent

      private void processEvent(Map<String,String> headers) throws IOException
      Processed the next event
      参数:
      headers - Content of event headers
      抛出:
      IOException
    • extractStats

      private SelectInputStream.Stats extractStats(ByteBuffer payload, String event) throws IOException
      Extracts the progress or final statistics from an XML document
      参数:
      payload - XML document
      event - Progress of Stats
      返回:
      Progress or final statistics
      抛出:
      IOException
    • extractPrelude

      private void extractPrelude() throws IOException
      Extracts and checks the prelude of an event
      抛出:
      IOException
    • extractHeaders

      Map<String,String> extractHeaders() throws IOException
      Extracts the headers of an event
      返回:
      Pairs of header message and value
      抛出:
      IOException
    • toLong

      private long toLong(int i)
      Conversion to integer to unsigned long integer
    • crc32

      private long crc32(int length)
      Computes the CRC32 of one of more bytes into the message buffer