core :: BytesReader
bytes in memoryvar reader = new BytesReader(b"a…b")
assert reader.read_char == 'a'
assert reader.read_byte == 0xE2 # 1st byte of '…'
assert reader.read_byte == 0x80 # 2nd byte of '…'
assert reader.read_char == '�' # Reads the last byte as an invalid char
assert reader.read_all_bytes == b"b"core $ BytesReader :: SELF
Type of this instance, automatically specialized in every classcore $ BytesReader :: raw_read_byte
Read a byte directly from the underlying stream, withoutcore $ BytesReader :: raw_read_bytes
Read at mostmax bytes from the underlying stream into buf,
			core $ BytesReader :: read_all_bytes
Read all the stream until the eof.core :: Reader :: append_line_to
Read a string until the end of the line and append it tos.
			binary :: BinaryStream :: big_endian
Use the big-endian convention? otherwise use little-endian.binary :: BinaryStream :: big_endian=
Use the big-endian convention? otherwise use little-endian.core :: Object :: class_factory
Implementation used byget_class to create the specific class.
			core :: Stream :: defaultinit
core :: BytesReader :: defaultinit
core :: Object :: defaultinit
binary :: BinaryStream :: defaultinit
core :: Reader :: defaultinit
core :: Reader :: deserialize_msgpack
Deserialize full Nitnullable Object from MessagePack formated data
			core :: Object :: is_same_instance
Return true ifself and other are the same instance (i.e. same identity).
			core :: Object :: is_same_serialized
Isself the same as other in a serialization context?
			core :: Object :: is_same_type
Return true ifself and other have the same dynamic type.
			core :: Stream :: last_error=
Error produced by the file streamcore :: Stream :: lookahead=
Lookahead buffer for codecscore :: Stream :: lookahead_capacity
Capacity of the lookaheadcore :: Stream :: lookahead_capacity=
Capacity of the lookaheadcore :: Stream :: lookahead_length
Current occupation of the lookaheadcore :: Stream :: lookahead_length=
Current occupation of the lookaheadcore :: Object :: output_class_name
Display class name on stdout (debug only).core :: Reader :: raw_read_byte
Read a byte directly from the underlying stream, withoutcore :: Reader :: raw_read_bytes
Read at mostmax bytes from the underlying stream into buf,
			core :: Reader :: read_block
Read the length as a 64 bits integer, then the content of the blockcore :: Reader :: read_bytes_to_cstring
Reads up tomax bytes from source and stores them in bytes
			core :: Reader :: read_double
Read a floating point on 64 bits and return it as aFloat
			core :: Reader :: read_float
Read a floating point on 32 bits and return it as aFloat
			core :: Reader :: read_int64
Read a signed integer on 64 bits and return is anInt
			core :: Reader :: read_msgpack
Read the next MessagePack object and return it as a simple Nit objectcore :: Reader :: read_nonwhitespace
Skip whitespace characters (if any) then return the following non-whitespace character.core :: Stream :: write_buffer
Buffer for writing data to a streamcore :: Stream :: write_buffer=
Buffer for writing data to a stream
# Read from `bytes` in memory
#
# ~~~
# var reader = new BytesReader(b"a…b")
# assert reader.read_char == 'a'
# assert reader.read_byte == 0xE2 # 1st byte of '…'
# assert reader.read_byte == 0x80 # 2nd byte of '…'
# assert reader.read_char == '�' # Reads the last byte as an invalid char
# assert reader.read_all_bytes == b"b"
# ~~~
class BytesReader
	super Reader
	# Source data to read
	var bytes: Bytes
	# The current position in `bytes`
	private var cursor = 0
	redef fun raw_read_byte
	do
		if cursor >= bytes.length then return -1
		var c = bytes[cursor]
		cursor += 1
		return c.to_i
	end
	redef fun close do bytes = new Bytes.empty
	redef fun read_all_bytes
	do
		var res = bytes.slice_from(cursor)
		cursor = bytes.length
		return res
	end
	redef fun raw_read_bytes(ns, max) do
		if cursor >= bytes.length then return 0
		var copy = max.min(bytes.length - cursor)
		bytes.items.copy_to(ns, copy, cursor, 0)
		cursor += copy
		return copy
	end
	redef fun eof do return cursor >= bytes.length
end
					lib/core/stream.nit:693,1--740,3