public class DataAtomOutputStream extends FilterOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected static long |
MAC_TIMESTAMP_EPOCH |
protected long |
written
The number of bytes written to the data output stream so far.
|
out| Constructor and Description |
|---|
DataAtomOutputStream(OutputStream out) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
incCount(int value)
Increases the written counter by the specified value
until it reaches Long.MAX_VALUE.
|
long |
size()
Returns the current value of the counter
written,
the number of bytes written to this data output stream so far. |
void |
write(byte[] b,
int off,
int len)
Writes
len bytes from the specified byte array
starting at offset off to the underlying output stream. |
void |
write(int b)
Writes the specified byte (the low eight bits of the argument
b) to the underlying output stream. |
void |
writeBCD2(int v)
Writes a
BCD2 to the underlying output stream. |
void |
writeBCD4(int v)
Writes a
BCD4 to the underlying output stream. |
void |
writeByte(int v)
Writes out a
byte to the underlying output stream as
a 1-byte value. |
void |
writeFixed16D16(double f)
Writes 32-bit fixed-point number divided as 16.16.
|
void |
writeFixed2D30(double f)
Writes 32-bit fixed-point number divided as 2.30.
|
void |
writeFixed8D8(double f)
Writes 32-bit fixed-point number divided as 8.8.
|
void |
writeInt(int v)
Writes an
int to the underlying output stream as four
bytes, high byte first. |
void |
writeInt24(int v) |
void |
writeInts(int[] i,
int off,
int len) |
void |
writeInts24(int[] i,
int off,
int len) |
void |
writeLong(long v) |
void |
writeMacTimestamp(Date date)
Writes a 32-bit Mac timestamp (seconds since 1902).
|
void |
writePString(String s)
Writes a Pascal String.
|
void |
writePString(String s,
int length)
Writes a Pascal String padded to the specified fixed size in bytes
|
void |
writeShort(int v)
Writes a signed 16 bit integer value.
|
void |
writeShorts(short[] s,
int off,
int len) |
void |
writeType(String s)
Writes an Atom Type identifier (4 bytes).
|
void |
writeUInt(long v)
Writes an unsigned 32 bit integer value.
|
void |
writeUShort(int v) |
close, flush, writeprotected static final long MAC_TIMESTAMP_EPOCH
protected long written
public DataAtomOutputStream(OutputStream out)
public void writeType(String s) throws IOException
s - A string with a length of 4 characters.IOExceptionpublic final void writeByte(int v)
throws IOException
byte to the underlying output stream as
a 1-byte value. If no exception is thrown, the counter
written is incremented by 1.v - a byte value to be written.IOException - if an I/O error occurs.FilterOutputStream.outpublic void write(byte[] b,
int off,
int len)
throws IOException
len bytes from the specified byte array
starting at offset off to the underlying output stream.
If no exception is thrown, the counter written is
incremented by len.write in class FilterOutputStreamb - the data.off - the start offset in the data.len - the number of bytes to write.IOException - if an I/O error occurs.FilterOutputStream.outpublic void write(int b)
throws IOException
b) to the underlying output stream. If no exception
is thrown, the counter written is incremented by
1.
Implements the write method of OutputStream.
write in class FilterOutputStreamb - the byte to be written.IOException - if an I/O error occurs.FilterOutputStream.outpublic void writeInt(int v)
throws IOException
int to the underlying output stream as four
bytes, high byte first. If no exception is thrown, the counter
written is incremented by 4.v - an int to be written.IOException - if an I/O error occurs.FilterOutputStream.outpublic void writeUInt(long v)
throws IOException
v - The valueIOExceptionpublic void writeShort(int v)
throws IOException
v - The valueIOExceptionpublic void writeBCD2(int v)
throws IOException
BCD2 to the underlying output stream.v - an int to be written.IOException - if an I/O error occurs.FilterOutputStream.outpublic void writeBCD4(int v)
throws IOException
BCD4 to the underlying output stream.v - an int to be written.IOException - if an I/O error occurs.FilterOutputStream.outpublic void writeMacTimestamp(Date date) throws IOException
date - IOExceptionpublic void writeFixed16D16(double f)
throws IOException
f - an int to be written.IOException - if an I/O error occurs.FilterOutputStream.outpublic void writeFixed2D30(double f)
throws IOException
f - an int to be written.IOException - if an I/O error occurs.FilterOutputStream.outpublic void writeFixed8D8(double f)
throws IOException
f - an int to be written.IOException - if an I/O error occurs.FilterOutputStream.outpublic void writePString(String s) throws IOException
s - IOExceptionpublic void writePString(String s, int length) throws IOException
s - length - the fixed size in bytesIOExceptionpublic void writeLong(long v)
throws IOException
IOExceptionpublic void writeUShort(int v)
throws IOException
IOExceptionprotected void incCount(int value)
public void writeShorts(short[] s,
int off,
int len)
throws IOException
IOExceptionpublic void writeInts(int[] i,
int off,
int len)
throws IOException
IOExceptionpublic void writeInt24(int v)
throws IOException
IOExceptionpublic void writeInts24(int[] i,
int off,
int len)
throws IOException
IOExceptionpublic final long size()
written,
the number of bytes written to this data output stream so far.
If the counter overflows, it will be wrapped to Integer.MAX_VALUE.written field.DataOutputStream.writtenCopyright © 2014. All Rights Reserved.