非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
readAsText
method is used to read the content of the
LockedFile
object and provide the result of that reading as a string. In many ways, it performs like the
FileReader.readAsText()
方法。
The reading operation starts at the position given by the
LockedFile.location
特性。
var request = instanceOfLockedFile.readAsText(size[, encoding]);
size
A number representing the number of bytes to read in the file.
encoding
可选
A string indicating the encoding to use for the returned data. By default, UTF-8 is assumed if this parameter is not specified.
A
FileRequest
object to handle the success or failure of the operation. In case of success, the request's
result
is a string representing the data that have been read.
| 规范 | 状态 | 注释 |
|---|---|---|
| FileSystem API | 编者草案 | Draft proposal |
LockedFile
abort()
append()
flush()
getMetadata()
readAsArrayBuffer()
readAsText()
truncate()
write()
FileError
FileException
FileHandle
FileRequest
FileSystem
FileSystemDirectoryEntry
FileSystemDirectoryEntrySync
FileSystemDirectoryReader
FileSystemDirectoryReaderSync
FileSystemEntry
FileSystemEntrySync
FileSystemFileEntry
FileSystemFileEntrySync
FileSystemFlags
FileSystemSync
HTMLInputElement
LocalFileSystem
LocalFileSystemSync
元数据
Window.requestFileSystem()
Window.resolveLocalFileSystemURL()
WorkerGlobalScope.requestFileSystemSync()