|
DixShtix | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.ByteArrayOutputStream | +--com.dixshtix.riff.IOChunk
Low-level IO routines for manipulating RIFF Chunks.
Field Summary | |
private int |
bytes_read
For read chunks, this is the portion of the contents being read. |
private FourByteConstant |
container_type
If not null, this should be one of FourByteConstant.RIFF ,
FourByteConstant.RIFX , or
FourByteConstant.LIST . |
(package private) byte[] |
contents
For read chunk, this is contents. |
private int |
guess_size
For read chunks, this is the size of the chunk from the file. |
private FourByteConstant |
id_type
Chunk type, or if this is a container, the container type. |
private OutStream |
o
For written chunks, this the output stream. |
Fields inherited from class java.io.ByteArrayOutputStream |
buf, count, isClosed |
Constructor Summary | |
(package private) |
IOChunk(FourByteConstant id,
int size)
Internal chunk creation from input stream. |
(package private) |
IOChunk(FourByteConstant container,
int size,
FourByteConstant id)
Internal container creation from input stream. |
|
IOChunk(OutStream o,
FourByteConstant id)
Preferred creation of a chunk on the output stream. |
|
IOChunk(OutStream o,
FourByteConstant container,
FourByteConstant id)
Preferred creation of a chunk or container on the output stream. |
|
IOChunk(OutStream o,
FourByteConstant container,
FourByteConstant id,
int guess)
Create a chunk or container on the output stream. |
|
IOChunk(OutStream o,
FourByteConstant id,
int guess)
Create a chunk on the output stream. |
Method Summary | |
boolean |
atEnd()
Test if we are at the end of this container or chunk. |
void |
close()
Close this chunk. |
void |
flush()
Flush a file. |
void |
fsf(long bytes)
Forward space file. |
FourByteConstant |
getChunkType()
Get chunk type. |
FourByteConstant |
getContainerType()
Obtain the type of container. |
byte[] |
getData()
Used for final chunks. |
int |
getSize()
Used for final chunks. |
boolean |
isContainer()
Test if this is a container. |
(package private) void |
setChunkType(FourByteConstant data)
Used by reading routines to set the chunk type late. |
void |
setData(byte[] data)
Used to finalize chunks. |
(package private) void |
writeBody(OutStream out)
Write variable-length output. |
(package private) void |
writeHeader(OutStream out)
Internal method to write the fixed header for a Chunk or container. |
Methods inherited from class java.io.ByteArrayOutputStream |
ensureOpen, reset, size, toByteArray, toString, toString, toString, write, write, writeTo |
Methods inherited from class java.io.OutputStream |
write |
Methods inherited from class java.lang.Object |
|
Field Detail |
private FourByteConstant container_type
FourByteConstant.RIFF
,
FourByteConstant.RIFX
, or
FourByteConstant.LIST
.private FourByteConstant id_type
private int guess_size
private int bytes_read
private OutStream o
byte[] contents
Constructor Detail |
public IOChunk(OutStream o, FourByteConstant container, FourByteConstant id, int guess)
o
- The output stream.container
- If not null, this is a container chunk type like
FourByteConstant.RIFF
,
FourByteConstant.RIFX
, or
FourByteConstant.LIST
.id
- The chunk or container identifier.guess
- Just a guess of the size of the contents of the chunk.public IOChunk(OutStream o, FourByteConstant id, int guess)
o
- The output stream.id
- The chunk or container identifier.guess
- Just a guess of the size of the contents of the chunk.public IOChunk(OutStream o, FourByteConstant container, FourByteConstant id)
o
- The output stream.container
- If not null, this is a container chunk type like
FourByteConstant.RIFF
,
FourByteConstant.RIFX
, or
FourByteConstant.LIST
.id
- The chunk or container identifier.public IOChunk(OutStream o, FourByteConstant id)
o
- The output stream.id
- The chunk or container identifier.IOChunk(FourByteConstant container, int size, FourByteConstant id)
container
- If not null, this is a container chunk type like
FourByteConstant.RIFF
,
FourByteConstant.RIFX
, or
FourByteConstant.LIST
.size
- The size of the chunk contents in bytes.id
- The chunk or container identifier.IOChunk(FourByteConstant id, int size)
size
- The size of the chunk contents in bytes.id
- The chunk or container identifier.Method Detail |
public void close() throws java.io.IOException
close
in class java.io.ByteArrayOutputStream
public void flush()
flush
in class java.io.OutputStream
void writeHeader(OutStream out) throws java.io.IOException
void writeBody(OutStream out) throws java.io.IOException
public boolean isContainer()
public FourByteConstant getContainerType()
public FourByteConstant getChunkType()
void setChunkType(FourByteConstant data)
public int getSize()
public byte[] getData()
public void setData(byte[] data)
public void fsf(long bytes)
public boolean atEnd()
|
DixShtix | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |