mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 17:59:39 +00:00
[io/doc] Document when read/readSync can return return less than requested bytes
Bug:https://github.com/dart-lang/sdk/issues/50034 Change-Id: Ib2f2b11bc3ae1fe241b71a43f2866233e066d8e2 CoreLibraryReviewExempt: Documentation-only change Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328802 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Brian Quinlan <bquinlan@google.com>
This commit is contained in:
parent
850bfe016e
commit
3fae23ae69
|
@ -631,10 +631,24 @@ abstract interface class RandomAccessFile {
|
|||
int readByteSync();
|
||||
|
||||
/// Reads up to [count] bytes from a file.
|
||||
///
|
||||
/// May return fewer than [count] bytes. This can happen, for example, when
|
||||
/// reading past the end of a file or when reading from a pipe that does not
|
||||
/// currently contain additional data.
|
||||
///
|
||||
/// An empty [Uint8List] will only be returned when reading past the end of
|
||||
/// the file or when [count] is `0`.
|
||||
Future<Uint8List> read(int count);
|
||||
|
||||
/// Synchronously reads up to [count] bytes from a file
|
||||
///
|
||||
/// May return fewer than [count] bytes. This can happen, for example, when
|
||||
/// reading past the end of a file or when reading from a pipe that does not
|
||||
/// currently contain additional data.
|
||||
///
|
||||
/// An empty [Uint8List] will only be returned when reading past the end of
|
||||
/// the file or when [count] is `0`.
|
||||
///
|
||||
/// Throws a [FileSystemException] if the operation fails.
|
||||
Uint8List readSync(int count);
|
||||
|
||||
|
|
Loading…
Reference in a new issue