JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / java / io / FileOutputStream.js
1 Clazz.load(["java.io.Closeable","$.OutputStream"],"java.io.FileOutputStream",["java.lang.IndexOutOfBoundsException","$.NullPointerException"],function(){\r
2 c$=Clazz.decorateAsClass(function(){\r
3 this.fd=null;\r
4 this.innerFD=false;\r
5 Clazz.instantialize(this,arguments);\r
6 },java.io,"FileOutputStream",java.io.OutputStream,java.io.Closeable);\r
7 Clazz.makeConstructor(c$,\r
8 function(file){\r
9 this.construct(file,false);\r
10 },"java.io.File");\r
11 Clazz.makeConstructor(c$,\r
12 function(file,append){\r
13 Clazz.superConstructor(this,java.io.FileOutputStream);\r
14 },"java.io.File,~B");\r
15 Clazz.makeConstructor(c$,\r
16 function(fd){\r
17 Clazz.superConstructor(this,java.io.FileOutputStream);\r
18 if(fd==null){\r
19 throw new NullPointerException(("K006c"));\r
20 }},"java.io.FileDescriptor");\r
21 Clazz.makeConstructor(c$,\r
22 function(filename){\r
23 this.construct(filename,false);\r
24 },"~S");\r
25 Clazz.makeConstructor(c$,\r
26 function(filename,append){\r
27 this.construct(Clazz.castNullAs("java.io.File"),append);\r
28 },"~S,~B");\r
29 Clazz.overrideMethod(c$,"close",\r
30 function(){\r
31 if(this.fd==null){\r
32 return;\r
33 }});\r
34 Clazz.overrideMethod(c$,"finalize",\r
35 function(){\r
36 this.close();\r
37 });\r
38 Clazz.defineMethod(c$,"getFD",\r
39 function(){\r
40 return this.fd;\r
41 });\r
42 Clazz.defineMethod(c$,"write",\r
43 function(buffer){\r
44 this.write(buffer,0,buffer.length);\r
45 },"~A");\r
46 Clazz.defineMethod(c$,"write",\r
47 function(buffer,offset,count){\r
48 if(buffer==null){\r
49 throw new NullPointerException();\r
50 }if(count<0||offset<0||offset>buffer.length||count>buffer.length-offset){\r
51 throw new IndexOutOfBoundsException();\r
52 }if(count==0){\r
53 return;\r
54 }},"~A,~N,~N");\r
55 Clazz.defineMethod(c$,"write",\r
56 function(oneByte){\r
57 },"~N");\r
58 });\r