Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / io / OutputStream.js
1 Clazz.load (["java.io.Closeable", "$.Flushable"], "java.io.OutputStream", ["java.lang.IndexOutOfBoundsException", "$.NullPointerException"], function () {
2 c$ = Clazz.declareType (java.io, "OutputStream", null, [java.io.Closeable, java.io.Flushable]);
3 Clazz.defineMethod (c$, "write", 
4 function (b, off, len) {
5 if (b == null) {
6 throw  new NullPointerException ();
7 } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
8 throw  new IndexOutOfBoundsException ();
9 } else if (len == 0) {
10 return;
11 }for (var i = 0; i < len; i++) {
12 this.writeByteAsInt (b[off + i]);
13 }
14 }, "~A,~N,~N");
15 Clazz.overrideMethod (c$, "flush", 
16 function () {
17 });
18 Clazz.overrideMethod (c$, "close", 
19 function () {
20 });
21 });