1 # This file is part of NIT (http://www.nitlanguage.org).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
18 var writer
= new FileWriter.open
(path
)
19 #alt1# writer.big_endian = false
20 #alt3# writer.big_endian = false
23 writer
.write_float
1.23456789
24 writer
.write_double
1.23456789
25 writer
.write_int64
123456789
26 print writer
.last_error
or else "no error"
29 var reader
= new FileReader.open
(path
)
30 #alt2# reader.big_endian = false
31 #alt3# reader.big_endian = false
33 print reader
.read_byte
or else "null"
34 print reader
.read_float
35 print reader
.read_double
36 print reader
.read_int64
37 print reader
.last_error
or else "no error"