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