Skip to content

Commit 893901e

Browse files
committed
setPosition -> seek
1 parent 6c1375b commit 893901e

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract class RandomAccessSource {
2525
Future<int> position();
2626
2727
/// Sets the current position in the source.
28-
Future<void> setPosition(int position);
28+
Future<void> seek(int position);
2929
3030
/// Closes the source.
3131
Future<void> close();

lib/src/bytes_ra_source.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class BytesRASource extends RandomAccessSource {
3232
}
3333

3434
@override
35-
Future<void> setPosition(int position) async {
36-
_syncSource.setPosition(position);
35+
Future<void> seek(int position) async {
36+
_syncSource.seek(position);
3737
}
3838

3939
@override
@@ -76,7 +76,7 @@ class SyncBytesRASource {
7676
return _position;
7777
}
7878

79-
void setPosition(int position) {
79+
void seek(int position) {
8080
_position = position;
8181
}
8282

lib/src/file_ra_source.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class FileRASource extends RandomAccessSource {
3434
}
3535

3636
@override
37-
Future<void> setPosition(int position) async {
37+
Future<void> seek(int position) async {
3838
await _file.setPosition(position);
3939
}
4040

lib/src/random_access_source.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract class RandomAccessSource {
1515
Future<int> position();
1616

1717
/// Sets the current position in the source.
18-
Future<void> setPosition(int position);
18+
Future<void> seek(int position);
1919

2020
/// Reads all the remaining bytes from the source.
2121
Future<Uint8List> readToEnd();

test/bytes_sync_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void main() {
5252
test('Position', () async {
5353
final src = _bytesSource();
5454
expect(src.position(), 0);
55-
src.setPosition(2);
55+
src.seek(2);
5656
expect(src.position(), 2);
5757
expect(src.readByte(), 3);
5858
});
@@ -65,7 +65,7 @@ void main() {
6565

6666
test('ReadToEnd (halfway)', () async {
6767
final src = _bytesSource();
68-
src.setPosition(2);
68+
src.seek(2);
6969
expect(src.readToEnd(), Uint8List.fromList([3, 4, 5]));
7070
expect(src.position(), 5);
7171
});

test/bytes_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void main() {
5555
test('Position', () async {
5656
final src = await _bytesSource();
5757
expect(await src.position(), 0);
58-
await src.setPosition(2);
58+
await src.seek(2);
5959
expect(await src.position(), 2);
6060
expect(await src.readByte(), 3);
6161
await src.close();
@@ -70,7 +70,7 @@ void main() {
7070

7171
test('ReadToEnd (halfway)', () async {
7272
final src = await _bytesSource();
73-
await src.setPosition(2);
73+
await src.seek(2);
7474
expect(await src.readToEnd(), Uint8List.fromList([3, 4, 5]));
7575
expect(await src.position(), 5);
7676
await src.close();

test/bytes_view_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void main() {
5656
test('Position', () async {
5757
final src = await _bytesSource();
5858
expect(await src.position(), 0);
59-
await src.setPosition(2);
59+
await src.seek(2);
6060
expect(await src.position(), 2);
6161
expect(await src.readByte(), 3);
6262
await src.close();
@@ -71,7 +71,7 @@ void main() {
7171

7272
test('ReadToEnd (halfway)', () async {
7373
final src = await _bytesSource();
74-
await src.setPosition(2);
74+
await src.seek(2);
7575
expect(await src.readToEnd(), Uint8List.fromList([3, 4, 5]));
7676
expect(await src.position(), 5);
7777
await src.close();

test/raf_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void main() {
6464
test('Position', () async {
6565
final src = await _rafSource();
6666
expect(await src.position(), 0);
67-
await src.setPosition(2);
67+
await src.seek(2);
6868
expect(await src.position(), 2);
6969
expect(await src.readByte(), 3);
7070
await src.close();
@@ -79,7 +79,7 @@ void main() {
7979

8080
test('ReadToEnd (halfway)', () async {
8181
final src = await _rafSource();
82-
await src.setPosition(2);
82+
await src.seek(2);
8383
expect(await src.readToEnd(), Uint8List.fromList([3, 4, 5]));
8484
expect(await src.position(), 5);
8585
await src.close();

0 commit comments

Comments
 (0)