static int? nextByte(List stream){ if (stream.isEmpty) return null; var nb = stream[0]; stream.removeRange(0, 1); return nb; }