jdk/test/java/io/IOException/LastErrorString.java
author jmasa
Wed, 04 Sep 2013 11:41:17 -0700
changeset 19730 4c38872d277e
parent 14342 8435a30053c1
child 32649 2ee9017c7597
permissions -rw-r--r--
8013938: Native OOME on fastdebug VM on Solaris Reviewed-by: azeemj, brutisso, kvn, tschatzl
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 10353
diff changeset
     2
 * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/* @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
   @bug 4167937
10353
cab797d3592b 7081813: ProblemList.txt updates (8/2011)
alanb
parents: 5506
diff changeset
    26
   @ignore Test truncates system files when run as root, see 7042603
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
   @summary Test code paths that use the JVM_LastErrorString procedure
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.File;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.FileInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.FileOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.io.RandomAccessFile;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
public class LastErrorString {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    static String UNWRITEABLE_DIR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    static String UNREADABLE_FILE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    static String READABLE_FILE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    static String WRITEABLE_FILE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    static String INVALID_PATH;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        if (File.separatorChar == '/') {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
            UNWRITEABLE_DIR = "/etc/dfs";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
            UNREADABLE_FILE = "/etc/shadow";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        } else if (File.separatorChar == '\\') {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
            UNREADABLE_FILE = "c:/pagefile.sys";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
            UNWRITEABLE_DIR = "z:/fooBAR/baz/GORP";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
            throw new RuntimeException("What kind of system is this?");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        File d = new File(System.getProperty("test.src", "."));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        READABLE_FILE = new File(d, "LastErrorString.java").getPath();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        WRITEABLE_FILE = "x.LastErrorString";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        String s = "foo/";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        for (;;) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
            s = s + s;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
            if (s.length() > 8192) break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        s += "bar";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
        INVALID_PATH = s;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    static abstract class Test {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        String name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        public Test(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            this.name = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        abstract public void run() throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        public void go() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                this.run();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
            } catch (IOException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                System.err.println(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                System.err.println("  " + x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
            System.err.println("WARNING: No exception for " + name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    static abstract class ClosedFISTest extends Test {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        FileInputStream in;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        public ClosedFISTest(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            super("FileInputStream." + name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        public void go() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
            this.in = new FileInputStream(READABLE_FILE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            this.in.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            super.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    static abstract class ClosedFOSTest extends Test {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        FileOutputStream out;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        public ClosedFOSTest(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            super("FileOutputStream." + name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        public void go() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            this.out = new FileOutputStream(WRITEABLE_FILE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            this.out.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            super.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    static abstract class ClosedRAFTest extends Test {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        RandomAccessFile raf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        public ClosedRAFTest(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            super("RandomAccessFile." + name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        public void go() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            this.raf = new RandomAccessFile(WRITEABLE_FILE, "rw");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            this.raf.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
            super.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    static abstract class ReadOnlyRAFTest extends Test {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        RandomAccessFile raf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        public ReadOnlyRAFTest(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            super("RandomAccessFile." + name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        public void go() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            this.raf = new RandomAccessFile(READABLE_FILE, "r");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
            super.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
            this.raf.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    static void go() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        new Test("File.createNewFile") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
                new File(UNWRITEABLE_DIR, "foo").createNewFile();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        new Test("File.getCanonicalpath") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                new File(INVALID_PATH).getCanonicalPath();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        new Test("FileInputStream(file)") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                new FileInputStream(UNREADABLE_FILE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        new Test("FileInputStream(dir)") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                new FileInputStream(".");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        new ClosedFISTest("read()") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                in.read();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        new ClosedFISTest("read(byte[])") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                byte[] b = new byte[10];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                in.read(b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        new ClosedFISTest("skip") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                in.skip(10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        new ClosedFISTest("available") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                in.available();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        new Test("FileOutputStream") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                new FileOutputStream(UNREADABLE_FILE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        new ClosedFOSTest("write()") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                out.write(10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        new ClosedFOSTest("write(byte[])") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                out.write(new byte[] { 1, 2, 3 });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        new Test("RandomAccessFile") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                new RandomAccessFile(UNREADABLE_FILE, "r");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        new ClosedRAFTest("getFilePointer") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                raf.getFilePointer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        new ClosedRAFTest("length") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                raf.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        new ClosedRAFTest("seek") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                raf.seek(20);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        new ClosedRAFTest("setLength") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
                raf.setLength(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        new ClosedRAFTest("readShort") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
                raf.readShort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        new ClosedRAFTest("readInt") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                raf.readInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        new ReadOnlyRAFTest("writeShort") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
                raf.writeShort(10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        new ReadOnlyRAFTest("getFilePointer") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
            public void run() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
                raf.writeInt(10);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
            }}.go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        go();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
}