Add an optional offset to File.readBytes().

This commit is contained in:
Bob Nystrom
2015-12-30 08:13:19 -08:00
parent 6e2ec92e0d
commit b054526df8
16 changed files with 104 additions and 18 deletions
+6
View File
@@ -10,4 +10,10 @@ System.print(file.readBytes(7)) // expect: this is
// Allows zero.
System.print(file.readBytes(0).bytes.count) // expect: 0
// A longer number reads the whole file.
System.print(file.readBytes(100)) // expect: this is a text file
// Reading past the end truncates the buffer.
System.print(file.readBytes(100).bytes.count) // expect: 19
file.close()