back to index
StdInStream
- associated with the <stdin> file stream
- transparent byte order conversion
- uses the ANSI-C <stdio.h> file functions
- also see the File, PakFile, StdOutStream and Stream classes.
Inheritance
Object -> Stream -> StdInStream
Properties
byteOrder - readwrite, BIG_ENDIAN or LITTLE_ENDIAN
object - read,
offset - readwrite
size - read
i8 - read byte from stream
i16 - read word from stream
i32 - read dword from stream
f32 - read floating point number from stream
f64 - convert float<->double
Constants
SEEK_BEG, SEEK_CUR, SEEK_END - arguments to seek()
Methods
close ()
deserialize (Object _o, int _rtti)
int eof ()
flush ()
int getByteOrder ()
int getErrorCode ()
String getErrorStringByCode (int _code)
int getI8 ()
int getI16 () - expands sign
int getI32 ()
float getF32 ()
getObject (Object _o)
int getOffset ()
int getSize ()
int isOpen ()
int readBuffer (Buffer _b, int _off, int _num, int _resize)
int readString (String _s, int _num)
seek (int _mode, int _off)
serialize (Object _o, int _rtti)
setByteOrder (int _order) - BIG_ENDIAN or LITTLE_ENDIAN
setOffset (int _off)
Example
// $ echo -n "hallo" | tks test.tks
String s;
trace StdInStream.readString(s, 2048);
trace "s.length="+s.length+" s=\""+s+"\"";
back to index