iostream.blob.len
Returns the stream length
Return value
See iostream.stream.len for the generic contract.
Notes
This is the length set by the constructor or resize, or grown implicitly by a write past the end (see writen). It does not depend on the cursor; use tell for that.
Example
from "iostream" import blob
let b = blob(4)
println("b.len() at start =", b.len())
b.seek(0, 'e')
b.writen(1, 'b') // writing past the end grows len
println("b.len() after writen past end =", b.len())
b.seek(0)
println("b.len() after seek(0) =", b.len()) // seeking never changes len, only tellOutput:
b.len() at start = 4
b.len() after writen past end = 5
b.len() after seek(0) = 5See also
len | Returns the stream length |
tell | Returns the current stream position |
resize | Resizes the blob to the given size |
| blob | class index |