Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:io
  3. Stdout class
Stdout
description

Stdout class

AnIOSink connected to either the standard out or error of the process.

Provides ablockingIOSink, so using it to write will block untilthe output is written.

In some situations this blocking behavior is undesirable as it does notprovide the same non-blocking behavior thatdart:io in general exposes.Use the propertynonBlocking to get anIOSink which has the non-blockingbehavior.

This class can also be used to check whetherstdout orstderr isconnected to a terminal and query some terminal properties.

TheaddError API is inherited fromStreamSink and calling it will resultin an unhandled asynchronous error unless there is an error handler ondone.

ThelineTerminator field is used by thewrite,writeln,writeAllandwriteCharCode methods to translate"\n". By default,"\n" isoutput literally.

Implemented types

Properties

doneFuture
A future that will complete when the consumer closes, or when anerror occurs.
no setterinherited
encodingEncoding
TheEncoding used when writing strings.
getter/setter pairinherited
hashCodeint
The hash code for this object.
no setterinherited
hasTerminalbool
Whether there is a terminal attached to stdout.
no setter
lineTerminatorString
Line ending appended bywriteln, and replacing"\n" in some methods.
getter/setter pairinherited
nonBlockingIOSink
A non-blockingIOSink for the same output.
no setter
runtimeTypeType
A representation of the runtime type of the object.
no setterinherited
supportsAnsiEscapesbool
Whether connected to a terminal that supports ANSI escape sequences.
no setter
terminalColumnsint
The number of columns of the terminal.
no setter
terminalLinesint
The number of lines of the terminal.
no setter

Methods

add(List<int>data)→ void
Adds bytedata to the target consumer, ignoringencoding.
inherited
addError(Objecterror, [StackTrace?stackTrace])→ void
Passes the error to the target consumer as an error event.
inherited
addStream(Stream<List<int>>stream)Future
Adds all elements of the givenstream.
inherited
close()Future
Close the target consumer.
inherited
flush()Future
Returns aFuture that completes once all buffered data is accepted by theunderlyingStreamConsumer.
inherited
noSuchMethod(Invocationinvocation)→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString()String
A string representation of this object.
inherited
write(Object?object)→ void
Convertsobject to a String by invokingObject.toString andadds the encoding of the result to the target consumer.
inherited
writeAll(Iterableobjects, [Stringsep =""])→ void
Iterates over the givenobjects andwrites them in sequence.
inherited
writeCharCode(intcharCode)→ void
Writes the character ofcharCode.
inherited
writeln([Object?object =""])→ void
Convertsobject to a String by invokingObject.toString andwrites the result tothis, followed by a newline.
inherited

Operators

operator ==(Objectother)bool
The equality operator.
inherited
  1. Dart
  2. dart:io
  3. Stdout class
dart:io library

[8]ページ先頭

©2009-2025 Movatter.jp