类 SelectInputStream
java.lang.Object
java.io.InputStream
cn.warpin.thirdPart.huawei.obs.obs.services.model.select.SelectInputStream
- 所有已实现的接口:
Closeable,AutoCloseable
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明private static final intprivate ByteBufferprivate static final intprivate booleanprivate intprivate InputStreamprivate byte[]private booleanprivate ByteBufferprivate intprivate static final Stringprivate intprivate SelectEventVisitorprivate static final String -
构造器概要
构造器构造器说明SelectInputStream(InputStream input) Creates an iterator over a binary input streamSelectInputStream(InputStream input, SelectEventVisitor visitor) Creates an iterator with an event visitor over a binary input stream -
方法概要
修饰符和类型方法说明voidabort()Informs that the serialization process must be aborted.intReturns the current number of bytes buffered.voidclose()Closes the streamprivate voidconsume(int len) Consumes some bytes from the current buffer.private longcrc32(int length) Computes the CRC32 of one of more bytes into the message bufferExtracts the headers of an eventprivate voidExtracts and checks the prelude of an eventprivate SelectInputStream.StatsextractStats(ByteBuffer payload, String event) Extracts the progress or final statistics from an XML documentprivate voidfetch(int len) 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 buffervoidmark(int readLimit) Marks the current position in the stream NOT SUPPORTEDbooleanReturns if stream marks are supported Default is false because marks are not supportedprivate voidprocessEvent(Map<String, String> headers) Processed the next eventintread()Returns the next character in the input streamintread(byte[] b, int off, int len) Returns an array of characters from the input streamvoidreset()Resets the stream NOT SUPPORTED, it raises an exceptionlongskip(long len) Skips one or more characters from the input streamprivate longtoLong(int i) Conversion to integer to unsigned long integer从类继承的方法 java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
字段详细资料
-
DEFAULT_MESSAGE_BUFFER_SIZE
private static final int DEFAULT_MESSAGE_BUFFER_SIZE- 另请参阅:
-
CHUNK_SIZE
private static final int CHUNK_SIZE- 另请参阅:
-
OCTET_STREAM_TYPE
- 另请参阅:
-
XML_STREAM_TYPE
- 另请参阅:
-
input
-
inputChunk
private byte[] inputChunk -
messageBuffer
-
visitor
-
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 streanvisitor- Event visitor
-
SelectInputStream
SelectInputStream(InputStream input) Creates an iterator over a binary input stream- 参数:
input- Binary input streanvisitor- 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
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
Returns an array of characters from the input stream- 覆盖:
read在类中InputStream- 参数:
b- Output byte arrayoff- Offset into the output arraylen- Max number of characters to read- 返回:
- The number of characters returned, or -1 when the input stream is closed or already consumed
- 抛出:
IOException
-
skip
Skips one or more characters from the input stream- 覆盖:
skip在类中InputStream- 参数:
len- Number of bytes to skip- 返回:
- Number of bytes skipped
- 抛出:
IOException
-
available
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
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
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
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
Processed the next event- 参数:
headers- Content of event headers- 抛出:
IOException
-
extractStats
Extracts the progress or final statistics from an XML document- 参数:
payload- XML documentevent- Progress of Stats- 返回:
- Progress or final statistics
- 抛出:
IOException
-
extractPrelude
Extracts and checks the prelude of an event- 抛出:
IOException
-
extractHeaders
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
-