ByteReadPacketPlatformBase
abstract class ByteReadPacketPlatformBase :
ByteReadPacketBase
Deprecated: Will be removed in future releases.
Constructors
ByteReadPacketPlatformBase( ByteReadPacketPlatformBase( |
Extension Properties
For streaming input it should be Input.endOfInput instead. |
|
For streaming input there is no reliable way to detect it without triggering bytes population from the underlying source. Consider using Input.endOfInput or use ByteReadPacket instead. |
Extension Functions
fun Input.asStream(): InputStream Convert io.ktor.utils.io Input to java InputStream |
|
fun Input.completeReadHead(current: ChunkBuffer): Unit |
|
Copy all bytes to the output. Depending on actual input and output implementation it could be zero-copy or copy byte per byte. All regular types such as ByteReadPacket, BytePacketBuilder, AbstractInput and AbstractOutput are always optimized so no bytes will be copied. |
|
Discard all remaining bytes. |
|
Discard exactly n bytes or fail if not enough bytes in the input to be discarded. |
|
Discards bytes until delimiter occurred |
|
Discards bytes until of of the specified delimiters delimiter1 or delimiter2 occurred |
|
For every byte from this input invokes block function giving it as parameter. |
|
fun Input. fun Input. Copy at least min but up to max bytes to the specified destination buffer from this input
skipping offset bytes. If there are not enough bytes available to provide min bytes then
it simply return number of available bytes with no exception so the returned value need
to be checked.
It is safe to specify |
|
fun Input.prepareReadFirstHead(minSize: Int): ChunkBuffer? |
|
fun Input.prepareReadNextHead( |
|
fun Input.readAvailable( fun Input.readAvailable( fun Input.readAvailable( fun Input.readAvailable( |
|
fun Input.readAvailableLittleEndian( fun Input.readAvailableLittleEndian( fun Input.readAvailableLittleEndian( fun Input.readAvailableLittleEndian( fun Input.readAvailableLittleEndian( fun Input.readAvailableLittleEndian( |
|
fun Input. fun Input. fun Input. |
|
Reads exactly n bytes from the input or fails if not enough bytes available. Reads all remaining bytes from the input |
|
Reads at least min but no more than max bytes from the input to a new byte array |
|
fun Input.readFully( fun Input.readFully( fun Input.readFully( fun Input.readFully( |
|
fun Input.readFullyLittleEndian( fun Input.readFullyLittleEndian( fun Input.readFullyLittleEndian( fun Input.readFullyLittleEndian( fun Input.readFullyLittleEndian( fun Input.readFullyLittleEndian( |
|
fun Input. fun Input. fun Input. |
|
fun Input. fun Input. Reads at most max characters decoding bytes with specified decoder. Extra character bytes will remain unconsumed fun Input.readText( Reads at most max characters decoding bytes with specified charset. Extra character bytes will remain unconsumed |
|
Read exactly n characters interpreting bytes in the specified charset. |
|
Read exactly the specified number of bytes interpreting bytes in the specified charset (optional, UTF-8 by default). Read exactly bytesCount interpreting bytes in the specified charset (optional, UTF-8 by default). |
|
Read exactly charactersCount characters interpreting bytes in the specified charset. |
|
fun Input.readUByte(): <ERROR CLASS> |
|
fun Input.readUInt(): <ERROR CLASS> |
|
fun Input.readULong(): <ERROR CLASS> |
|
fun Input.readUShort(): <ERROR CLASS> |
|
Read a string line considering optionally specified estimate but up to optional limit characters length
(does fail once limit exceeded) or return |
|
fun Input.readUTF8LineTo( Read UTF-8 line and append all line characters to out except line endings. Does support CR, LF and CR+LF |
|
Reads UTF-8 characters until one of the specified delimiters found, limit exceeded or end of stream encountered |
|
fun Input.readUTF8UntilDelimiterTo( fun Input.readUTF8UntilDelimiterTo( Reads UTF-8 characters to out buffer until one of the specified delimiters found, limit exceeded or end of stream encountered fun Input. |
|
fun Input.readUntilDelimiter( Copies to dst array at offset at most length bytes or until the specified delimiter occurred. Copies to dst output until the specified delimiter occurred. |
|
fun Input.readUntilDelimiters( Copies to dst array at offset at most length bytes or until one of the specified delimiters delimiter1 or delimiter2 occurred. Copies to dst output until one of the specified delimiters delimiter1 or delimiter2 occurred. |
|
Invoke block function for every chunk until end of input or block function return |
|
Invoke block function for every chunk until end of input or block function return zero block function returns number of bytes required to read next primitive and shouldn’t require too many bytes at once otherwise it could fail with an exception. It is not guaranteed that every chunk will have fixed size but it will be always at least requested bytes length. block function should never release provided buffer and should not write to it otherwise an undefined behaviour could be observed |
Inheritors
class ByteReadPacket : ByteReadPacketPlatformBase, Input Read-only immutable byte packet. Could be consumed only once however it does support copy that doesn’t copy every byte but creates a new view instead. Once packet created it should be either completely read (consumed) or released via release. |