73 |
public static final int SYNC = 16; |
public static final int SYNC = 16; |
74 |
public static final int DSYNC = 32; |
public static final int DSYNC = 32; |
75 |
|
|
76 |
|
public static FileChannelImpl in; |
77 |
|
public static FileChannelImpl out; |
78 |
|
public static FileChannelImpl err; |
79 |
|
|
80 |
private static native void init(); |
private static native void init(); |
81 |
|
|
82 |
static |
static |
87 |
} |
} |
88 |
|
|
89 |
init(); |
init(); |
90 |
|
|
91 |
|
in = new FileChannelImpl(0,READ); |
92 |
|
out = new FileChannelImpl(1,WRITE); |
93 |
|
err = new FileChannelImpl(2,WRITE); |
94 |
} |
} |
95 |
|
|
96 |
/** |
/** |
138 |
} |
} |
139 |
} |
} |
140 |
|
|
141 |
/* Used by init() (native code) */ |
/** |
142 |
|
* Constructor for default channels in, out and err. |
143 |
|
* |
144 |
|
* Used by init() (native code). |
145 |
|
* |
146 |
|
* @param fd the file descriptor (0, 1, 2 for stdin, stdout, stderr). |
147 |
|
* |
148 |
|
* @param mode READ or WRITE |
149 |
|
*/ |
150 |
FileChannelImpl (int fd, int mode) |
FileChannelImpl (int fd, int mode) |
151 |
{ |
{ |
152 |
this.fd = fd; |
this.fd = fd; |
153 |
this.mode = mode; |
this.mode = mode; |
154 |
} |
} |
155 |
|
|
|
public static FileChannelImpl in; |
|
|
public static FileChannelImpl out; |
|
|
public static FileChannelImpl err; |
|
|
|
|
156 |
private native int open (String path, int mode) throws FileNotFoundException; |
private native int open (String path, int mode) throws FileNotFoundException; |
157 |
|
|
158 |
public native int available () throws IOException; |
public native int available () throws IOException; |