class · System.IO

Stream

public class System.IO.Stream : System.Any

A sequence of bytes. A stream says what it can do (CanRead, CanWrite, CanSeek); what it cannot do throws IOError.

Tipo
class
Espacio de nombres
System.IO
Ensamblado
System.Core
Acceso
public, abstract
Archivo fuente
Stream.ant

Herencia

Clases base
Any Stream
Tipos derivados
BufferedStream FileStream HandleStream MemoryStream

Propiedades

property CanRead: bool
#

read-only

property CanWrite: bool
#

read-only

property CanSeek: bool
#

read-only

property Length: i64
#

read-only

How many bytes it has (streams that can seek).

property Position: i64
#

Where the next byte is read or written (streams that can seek).

Métodos

method Read(buffer: u8[], offset: i32, count: i32) -> i32
#

virtual

Reads up to count bytes into buffer[offset..]: how many (0 only at the end).

method Write(buffer: u8[], offset: i32, count: i32) -> void
#

virtual

Writes buffer[offset..offset + count].

method Seek(offset: i64, origin: System.IO.SeekOrigin) -> i64
#

virtual

Moves to offset from origin: the new position.

method SetLength(length: i64) -> void
#

virtual

Makes it length bytes long (cutting or adding zeros).

method Flush() -> void
#

virtual

Sends what is buffered to where the stream ends up.

method Close() -> void
#

virtual

Flushes and lets go of what the stream holds; using it afterwards throws.

method ReadByte() -> i32
#

virtual

The next byte (0–255), or -1 at the end.

method WriteByte(value: u8) -> void
#

virtual

method Read(buffer: u8[]) -> i32
#

Reads up to buffer.Length bytes: how many (0 only at the end).

method Write(buffer: u8[]) -> void
#
method ReadExactly(buffer: u8[], offset: i32, count: i32) -> void
#

Reads exactly count bytes into buffer[offset..] (EndOfStreamError if the stream ends first).

method ReadToEnd() -> u8[]
#

Everything from the position to the end.

method CopyTo(destination: System.IO.Stream) -> void
#

Copies everything from the position to the end into destination.

method CopyTo(destination: System.IO.Stream, bufferSize: i32) -> void
#

Miembros heredados (5)

Código fuente

Stream en Larva HIR, descompilado a partir de su Larva HIR.

System.IO.Stream.hir
// A sequence of bytes. A stream says what it can do (CanRead, CanWrite, CanSeek); what it cannot do throws IOError.
public class System.IO.Stream : System.Any
{
    // Reads up to `count` bytes into buffer[offset..]: how many (0 only at the end).
    method Read(buffer: u8[], offset: i32, count: i32) -> i32
    // Writes buffer[offset..offset + count].
    method Write(buffer: u8[], offset: i32, count: i32) -> void
    // Moves to `offset` from `origin`: the new position.
    method Seek(offset: i64, origin: System.IO.SeekOrigin) -> i64
    // Makes it `length` bytes long (cutting or adding zeros).
    method SetLength(length: i64) -> void
    // Sends what is buffered to where the stream ends up.
    method Flush() -> void
    // Flushes and lets go of what the stream holds; using it afterwards throws.
    method Close() -> void
    // The next byte (0–255), or -1 at the end.
    method ReadByte() -> i32
    method WriteByte(value: u8) -> void
    // Reads up to buffer.Length bytes: how many (0 only at the end).
    method Read(buffer: u8[]) -> i32
    method Write(buffer: u8[]) -> void
    // Reads exactly `count` bytes into buffer[offset..] (EndOfStreamError if the stream ends first).
    method ReadExactly(buffer: u8[], offset: i32, count: i32) -> void
    // Everything from the position to the end.
    method ReadToEnd() -> u8[]
    // Copies everything from the position to the end into `destination`.
    method CopyTo(destination: System.IO.Stream) -> void
    method CopyTo(destination: System.IO.Stream, bufferSize: i32) -> void
    property CanRead: bool
    property CanWrite: bool
    property CanSeek: bool
    // How many bytes it has (streams that can seek).
    property Length: i64
    // Where the next byte is read or written (streams that can seek).
    property Position: i64
}
Esc