An Output is an abstract write. A specific output implementation will only
have to override the writeByte
and maybe the write
, flush
and close
methods. See File.write
and String.write
for two ways of creating an
Output.
Methods
prepare (nbytes:Int):Void
Inform that we are about to write at least nbytes
bytes.
The underlying implementation can allocate proper working space depending on this information, or simply ignore it. This is not a mandatory call but a tip and is only used in some specific cases.
writeBytes (s:Bytes, pos:Int, len:Int):Int
Write len
bytes from s
starting by position specified by pos
.
Returns the actual length of written data that can differ from len
.
See writeFullBytes
that tries to write the exact amount of specified bytes.
writeFullBytes (s:Bytes, pos:Int, len:Int):Void
Write len
bytes from s
starting by position specified by pos
.
Unlike writeBytes
, this method tries to write the exact len
amount of bytes.