Package xyz.cofe.trambda.tcp
Class BuffInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.io.BufferedInputStream
-
- xyz.cofe.trambda.tcp.BuffInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class BuffInputStream extends BufferedInputStream
Буфферизированный поток, с информацией о текущем состоянии
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description BuffInputStream(InputStream in)КонструкторBuffInputStream(InputStream in, int size)Конструктор
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcount()Отметка доступных данных в буфереintmarkpos()Отметка текущей позицииintpos()The value of the pos field at the time the last mark method was called.-
Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, read, read, reset, skip
-
Methods inherited from class java.io.FilterInputStream
read
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
BuffInputStream
public BuffInputStream(InputStream in)
Конструктор- Parameters:
in- входящий поток
-
BuffInputStream
public BuffInputStream(InputStream in, int size)
Конструктор- Parameters:
in- входящий потокsize- размер буфера в байтах
-
-
Method Detail
-
pos
public int pos()
The value of the pos field at the time the last mark method was called. This value is always in the range -1 through pos. If there is no marked position in the input stream, this field is -1. If there is a marked position in the input stream, then buf[markpos] is the first byte to be supplied as input after a reset operation. If markpos is not -1, then all bytes from positions buf[markpos] through buf[pos-1] must remain in the buffer array (though they may be moved to another place in the buffer array, with suitable adjustments to the values of count, pos, and markpos); they may not be discarded unless and until the difference between pos and markpos exceeds marklimit.- Returns:
- метка текущей позиции в буфере
-
markpos
public int markpos()
Отметка текущей позиции- Returns:
- Отметка текущей позиции
-
count
public int count()
Отметка доступных данных в буфере- Returns:
- Отметка доступных данных в буфере
-
-