663 lines · 26.5 KB · Java
RawDownload
     * and written out first.  The bit offset will be 0 after the     * write.     *     * @param i an array of <code>int</code>s to be written.     * @param off the start offset in the data.     * @param len the number of <code>int</code>s to write.     *     * @exception IndexOutOfBoundsException if <code>off</code> is     * negative, <code>len</code> is negative, or <code>off +     * len</code> is greater than <code>i.length</code>.     * @exception NullPointerException if <code>i</code> is     * <code>null</code>.     * @exception IOException if an I/O error occurs.     */    void writeInts(int[] i, int off, int len) throws IOException;     /**     * Writes a sequence of longs to the stream at the current     * position.  If <code>len</code> is 0, nothing is written.     * The long <code>l[off]</code> is written first, then the long     * <code>l[off + 1]</code>, and so on.  The byte order of the     * stream is used to determine the order in which the individual     * bytes are written.     *     * <p> If the bit offset within the stream is non-zero, the     * remainder of the current byte is padded with 0s     * and written out first.  The bit offset will be 0 after the     * write.     *     * @param l an array of <code>long</code>s to be written.     * @param off the start offset in the data.     * @param len the number of <code>long</code>s to write.     *     * @exception IndexOutOfBoundsException if <code>off</code> is     * negative, <code>len</code> is negative, or <code>off +     * len</code> is greater than <code>l.length</code>.     * @exception NullPointerException if <code>l</code> is     * <code>null</code>.     * @exception IOException if an I/O error occurs.     */    void writeLongs(long[] l, int off, int len) throws IOException;     /**     * Writes a sequence of floats to the stream at the current     * position.  If <code>len</code> is 0, nothing is written.     * The float <code>f[off]</code> is written first, then the float     * <code>f[off + 1]</code>, and so on.  The byte order of the     * stream is used to determine the order in which the individual     * bytes are written.     *     * <p> If the bit offset within the stream is non-zero, the     * remainder of the current byte is padded with 0s     * and written out first.  The bit offset will be 0 after the     * write.     *     * @param f an array of <code>float</code>s to be written.     * @param off the start offset in the data.     * @param len the number of <code>float</code>s to write.     *     * @exception IndexOutOfBoundsException if <code>off</code> is     * negative, <code>len</code> is negative, or <code>off +     * len</code> is greater than <code>f.length</code>.     * @exception NullPointerException if <code>f</code> is     * <code>null</code>.     * @exception IOException if an I/O error occurs.     */    void writeFloats(float[] f, int off, int len) throws IOException;     /**     * Writes a sequence of doubles to the stream at the current     * position.  If <code>len</code> is 0, nothing is written.     * The double <code>d[off]</code> is written first, then the double     * <code>d[off + 1]</code>, and so on.  The byte order of the     * stream is used to determine the order in which the individual     * bytes are written.     *     * <p> If the bit offset within the stream is non-zero, the     * remainder of the current byte is padded with 0s     * and written out first.  The bit offset will be 0 after the     * write.     *     * @param d an array of <code>doubles</code>s to be written.     * @param off the start offset in the data.     * @param len the number of <code>double</code>s to write.     *     * @exception IndexOutOfBoundsException if <code>off</code> is     * negative, <code>len</code> is negative, or <code>off +     * len</code> is greater than <code>d.length</code>.     * @exception NullPointerException if <code>d</code> is     * <code>null</code>.     * @exception IOException if an I/O error occurs.     */    void writeDoubles(double[] d, int off, int len) throws IOException;     /**     * Writes a single bit, given by the least significant bit of the     * argument, to the stream at the current bit offset within the     * current byte position.  The upper 31 bits of the argument are     * ignored.  The given bit replaces the previous bit at that     * position.  The bit offset is advanced by one and reduced modulo     * 8.     *     * <p> If any bits of a particular byte have never been set     * at the time the byte is flushed to the destination, those     * bits will be set to 0 automatically.     *     * @param bit an <code>int</code> whose least significant bit     * is to be written to the stream.     *     * @exception IOException if an I/O error occurs.     */    void writeBit(int bit) throws IOException;     /**     * Writes a sequence of bits, given by the <code>numBits</code>     * least significant bits of the <code>bits</code> argument in     * left-to-right order, to the stream at the current bit offset     * within the current byte position.  The upper <code>64 -     * numBits</code> bits of the argument are ignored.  The bit     * offset is advanced by <code>numBits</code> and reduced modulo     * 8.  Note that a bit offset of 0 always indicates the     * most-significant bit of the byte, and bytes of bits are written     * out in sequence as they are encountered.  Thus bit writes are     * always effectively in network byte order.  The actual stream     * byte order setting is ignored.     *     * <p> Bit data may be accumulated in memory indefinitely, until     * <code>flushBefore</code> is called.  At that time, all bit data     * prior to the flushed position will be written.     *     * <p> If any bits of a particular byte have never been set     * at the time the byte is flushed to the destination, those     * bits will be set to 0 automatically.     *     * @param bits a <code>long</code> containing the bits to be     * written, starting with the bit in position <code>numBits -     * 1</code> down to the least significant bit.     *     * @param numBits an <code>int</code> between 0 and 64, inclusive.     *     * @exception IllegalArgumentException if <code>numBits</code> is     * not between 0 and 64, inclusive.     * @exception IOException if an I/O error occurs.     */    void writeBits(long bits, int numBits) throws IOException;     /**     * Flushes all data prior to the given position to the underlying     * destination, such as an <code>OutputStream</code> or     * <code>File</code>.  Attempting to seek to the flushed portion     * of the stream will result in an     * <code>IndexOutOfBoundsException</code>.     *     * @param pos a <code>long</code> containing the length of the     * stream prefix that may be flushed to the destination.     *     * @exception IndexOutOfBoundsException if <code>pos</code> lies     * in the flushed portion of the stream or past the current stream     * position.     * @exception IOException if an I/O error occurs.     */    void flushBefore(long pos) throws IOException;}

Lines 501–663 of 663. Previous lines