APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.media.sound

public final Class RIFFWriter

extends OutputStream
Class Inheritance
Imports
java.io.File, .FileNotFoundException, .IOException, .OutputStream, .RandomAccessFile

Resource Interchange File Format (RIFF) stream encoder.
Author
Karl Helgason

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static interface

Field Summary

Modifier and TypeField and Description
private RIFFWriter
private final long
private int
private boolean
private RIFFWriter.RandomAccessWriter
private final long
private boolean

Constructor Summary

AccessConstructor and Description
public
RIFFWriter(String name, String format)

public
RIFFWriter(File file, String format)

public
RIFFWriter(OutputStream stream, String format)

private
RIFFWriter(RIFFWriter.RandomAccessWriter raf, String format, int chunktype)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with this stream.

public long
public boolean
public void
seek(long pos)

public void
setWriteOverride(boolean writeoverride)

public void
write(int b)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.

public void
write(byte[] b, int off, int len)

Overrides java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

public void
writeByte(int b)

public RIFFWriter
public void
writeInt(int b)

public RIFFWriter
writeList(String format)

public void
writeLong(long b)

public void
writeShort(short b)

public void
public void
writeString(String string, int len)

public void
public void
public void
Inherited from java.io.OutputStream:
flushnullOutputStreamwrite

Field Detail

childchunkback to summary
private RIFFWriter childchunk
chunksizepointerback to summary
private final long chunksizepointer
chunktypeback to summary
private int chunktype
openback to summary
private boolean open
rafback to summary
private RIFFWriter.RandomAccessWriter raf
startpointerback to summary
private final long startpointer
writeoverrideback to summary
private boolean writeoverride

Constructor Detail

RIFFWriterback to summary
public RIFFWriter(String name, String format) throws IOException
RIFFWriterback to summary
public RIFFWriter(File file, String format) throws IOException
RIFFWriterback to summary
public RIFFWriter(OutputStream stream, String format) throws IOException
RIFFWriterback to summary
private RIFFWriter(RIFFWriter.RandomAccessWriter raf, String format, int chunktype) throws IOException

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.OutputStream.close.

Closes this output stream and releases any system resources associated with this stream. The general contract of close is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getFilePointerback to summary
public long getFilePointer() throws IOException
getWriteOverrideback to summary
public boolean getWriteOverride()
seekback to summary
public void seek(long pos) throws IOException
setWriteOverrideback to summary
public void setWriteOverride(boolean writeoverride)
writeback to summary
public void write(int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream. The general contract for write(b, off, len) is that some of the bytes in the array b are written to the output stream in order; element b[off] is the first byte written and b[off+len-1] is the last byte written by this operation.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
writeByteback to summary
public void writeByte(int b) throws IOException
writeChunkback to summary
public RIFFWriter writeChunk(String format) throws IOException
writeIntback to summary
public void writeInt(int b) throws IOException
writeListback to summary
public RIFFWriter writeList(String format) throws IOException
writeLongback to summary
public void writeLong(long b) throws IOException
writeShortback to summary
public void writeShort(short b) throws IOException
writeStringback to summary
public void writeString(String string) throws IOException
writeStringback to summary
public void writeString(String string, int len) throws IOException
writeUnsignedByteback to summary
public void writeUnsignedByte(int b) throws IOException
writeUnsignedIntback to summary
public void writeUnsignedInt(long b) throws IOException
writeUnsignedShortback to summary
public void writeUnsignedShort(int b) throws IOException
com.sun.media.sound back to summary

private Class RIFFWriter.RandomAccessByteWriter

extends Object
implements RandomAccessWriter
Class Inheritance
All Implemented Interfaces
com.sun.media.sound.RIFFWriter.RandomAccessWriter

Field Summary

Modifier and TypeField and Description
pack-priv byte[]
pack-priv int
pack-priv int
pack-priv byte[]
s

pack-priv final OutputStream

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public long
public long
public void
public void
public void
public void
write(byte[] b, int off, int len)

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.write.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

buffback to summary
pack-priv byte[] buff
lengthback to summary
pack-priv int length
posback to summary
pack-priv int pos
sback to summary
pack-priv byte[] s
streamback to summary
pack-priv final OutputStream stream

Constructor Detail

RandomAccessByteWriterback to summary
pack-priv RandomAccessByteWriter(OutputStream stream)

Method Detail

closeback to summary
public void close() throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.close.

Annotations
@Override
getPointerback to summary
public long getPointer() throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.getPointer.

Annotations
@Override
lengthback to summary
public long length() throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.length.

Annotations
@Override
seekback to summary
public void seek(long chunksizepointer) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.seek.

Annotations
@Override
setLengthback to summary
public void setLength(long i) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.setLength.

Annotations
@Override
writeback to summary
public void write(int b) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.write.

Annotations
@Override
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.write.

Annotations
@Override
writeback to summary
public void write(byte[] bytes) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.write.

Annotations
@Override
com.sun.media.sound back to summary

private Class RIFFWriter.RandomAccessFileWriter

extends Object
implements RandomAccessWriter
Class Inheritance
All Implemented Interfaces
com.sun.media.sound.RIFFWriter.RandomAccessWriter

Field Summary

Modifier and TypeField and Description
pack-priv RandomAccessFile

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public long
public long
public void
public void
public void
public void
write(byte[] b, int off, int len)

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.write.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rafback to summary
pack-priv RandomAccessFile raf

Constructor Detail

RandomAccessFileWriterback to summary
pack-priv RandomAccessFileWriter(File file) throws FileNotFoundException
RandomAccessFileWriterback to summary
pack-priv RandomAccessFileWriter(String name) throws FileNotFoundException

Method Detail

closeback to summary
public void close() throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.close.

Annotations
@Override
getPointerback to summary
public long getPointer() throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.getPointer.

Annotations
@Override
lengthback to summary
public long length() throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.length.

Annotations
@Override
seekback to summary
public void seek(long chunksizepointer) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.seek.

Annotations
@Override
setLengthback to summary
public void setLength(long i) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.setLength.

Annotations
@Override
writeback to summary
public void write(int b) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.write.

Annotations
@Override
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.write.

Annotations
@Override
writeback to summary
public void write(byte[] bytes) throws IOException

Implements com.sun.media.sound.RIFFWriter.RandomAccessWriter.write.

Annotations
@Override
com.sun.media.sound back to summary

private Interface RIFFWriter.RandomAccessWriter

Known Direct Implementers
com.sun.media.sound.RIFFWriter.RandomAccessFileWriter, com.sun.media.sound.RIFFWriter.RandomAccessByteWriter

Method Summary

Modifier and TypeMethod and Description
public void
public long
public long
public void
seek(long chunksizepointer)

public void
setLength(long i)

public void
write(int b)

public void
write(byte[] b, int off, int len)

public void
write(byte[] bytes)

Method Detail

closeback to summary
public void close() throws IOException
getPointerback to summary
public long getPointer() throws IOException
lengthback to summary
public long length() throws IOException
seekback to summary
public void seek(long chunksizepointer) throws IOException
setLengthback to summary
public void setLength(long i) throws IOException
writeback to summary
public void write(int b) throws IOException
writeback to summary
public void write(byte[] b, int off, int len) throws IOException
writeback to summary
public void write(byte[] bytes) throws IOException