< prev index next >

src/java.desktop/share/classes/javax/imageio/stream/ImageOutputStream.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  70      */
  71     void write(int b) throws IOException;
  72 
  73     /**
  74      * Writes a sequence of bytes to the stream at the current
  75      * position.  If {@code b.length} is 0, nothing is written.
  76      * The byte {@code b[0]} is written first, then the byte
  77      * {@code b[1]}, and so on.
  78      *
  79      * <p> If the bit offset within the stream is non-zero, the
  80      * remainder of the current byte is padded with 0s
  81      * and written out first.  The bit offset will be 0 after the
  82      * write.
  83      *
  84      * @param b an array of {@code byte}s to be written.
  85      *
  86      * @exception NullPointerException if {@code b} is
  87      * {@code null}.
  88      * @exception IOException if an I/O error occurs.
  89      */
  90     void write(byte b[]) throws IOException;
  91 
  92     /**
  93      * Writes a sequence of bytes to the stream at the current
  94      * position.  If {@code len} is 0, nothing is written.
  95      * The byte {@code b[off]} is written first, then the byte
  96      * {@code b[off + 1]}, and so on.
  97      *
  98      * <p> If the bit offset within the stream is non-zero, the
  99      * remainder of the current byte is padded with 0s
 100      * and written out first.  The bit offset will be 0 after the
 101      * write.  Implementers can use the
 102      * {@link ImageOutputStreamImpl#flushBits flushBits}
 103      * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
 104      * to guarantee this.
 105      *
 106      * @param b an array of {@code byte}s to be written.
 107      * @param off the start offset in the data.
 108      * @param len the number of {@code byte}s to write.
 109      *
 110      * @exception IndexOutOfBoundsException if {@code off} is
 111      * negative, {@code len} is negative, or {@code off + len}
 112      * is greater than {@code b.length}.
 113      * @exception NullPointerException if {@code b} is
 114      * {@code null}.
 115      * @exception IOException if an I/O error occurs.
 116      */
 117     void write(byte b[], int off, int len) throws IOException;
 118 
 119     /**
 120      * Writes a {@code boolean} value to the stream.  If
 121      * {@code v} is true, the value {@code (byte)1} is
 122      * written; if {@code v} is false, the value
 123      * {@code (byte)0} is written.
 124      *
 125      * <p> If the bit offset within the stream is non-zero, the
 126      * remainder of the current byte is padded with 0s
 127      * and written out first.  The bit offset will be 0 after the
 128      * write.
 129      *
 130      * @param v the {@code boolean} to be written.
 131      *
 132      * @exception IOException if an I/O error occurs.
 133      */
 134     void writeBoolean(boolean v) throws IOException;
 135 
 136     /**
 137      * Writes the 8 low-order bits of {@code v} to the


   1 /*
   2  * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  70      */
  71     void write(int b) throws IOException;
  72 
  73     /**
  74      * Writes a sequence of bytes to the stream at the current
  75      * position.  If {@code b.length} is 0, nothing is written.
  76      * The byte {@code b[0]} is written first, then the byte
  77      * {@code b[1]}, and so on.
  78      *
  79      * <p> If the bit offset within the stream is non-zero, the
  80      * remainder of the current byte is padded with 0s
  81      * and written out first.  The bit offset will be 0 after the
  82      * write.
  83      *
  84      * @param b an array of {@code byte}s to be written.
  85      *
  86      * @exception NullPointerException if {@code b} is
  87      * {@code null}.
  88      * @exception IOException if an I/O error occurs.
  89      */
  90     void write(byte[] b) throws IOException;
  91 
  92     /**
  93      * Writes a sequence of bytes to the stream at the current
  94      * position.  If {@code len} is 0, nothing is written.
  95      * The byte {@code b[off]} is written first, then the byte
  96      * {@code b[off + 1]}, and so on.
  97      *
  98      * <p> If the bit offset within the stream is non-zero, the
  99      * remainder of the current byte is padded with 0s
 100      * and written out first.  The bit offset will be 0 after the
 101      * write.  Implementers can use the
 102      * {@link ImageOutputStreamImpl#flushBits flushBits}
 103      * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
 104      * to guarantee this.
 105      *
 106      * @param b an array of {@code byte}s to be written.
 107      * @param off the start offset in the data.
 108      * @param len the number of {@code byte}s to write.
 109      *
 110      * @exception IndexOutOfBoundsException if {@code off} is
 111      * negative, {@code len} is negative, or {@code off + len}
 112      * is greater than {@code b.length}.
 113      * @exception NullPointerException if {@code b} is
 114      * {@code null}.
 115      * @exception IOException if an I/O error occurs.
 116      */
 117     void write(byte[] b, int off, int len) throws IOException;
 118 
 119     /**
 120      * Writes a {@code boolean} value to the stream.  If
 121      * {@code v} is true, the value {@code (byte)1} is
 122      * written; if {@code v} is false, the value
 123      * {@code (byte)0} is written.
 124      *
 125      * <p> If the bit offset within the stream is non-zero, the
 126      * remainder of the current byte is padded with 0s
 127      * and written out first.  The bit offset will be 0 after the
 128      * write.
 129      *
 130      * @param v the {@code boolean} to be written.
 131      *
 132      * @exception IOException if an I/O error occurs.
 133      */
 134     void writeBoolean(boolean v) throws IOException;
 135 
 136     /**
 137      * Writes the 8 low-order bits of {@code v} to the


< prev index next >