|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.me.parabola.imgfmt.app.SectionWriter
public class SectionWriter
A section writer wraps a regular writer so that all the offsets are relative to the start of a section.
Constructor Summary | |
---|---|
SectionWriter(ImgFileWriter writer,
Section section)
|
Method Summary | |
---|---|
void |
close()
Note that this does not close the underlying file. |
long |
getSize()
Returns the size of the file. |
int |
position()
Get the position. |
void |
position(long pos)
Set the position of the file. |
void |
put(byte b)
Write out a single byte. |
void |
put(byte[] val)
Write out an arbitrary length sequence of bytes. |
void |
put(byte[] src,
int start,
int length)
Write out part of a byte array. |
void |
put3(int val)
Write out three bytes. |
void |
putChar(char c)
Write out two bytes. |
void |
putInt(int val)
Write out 4 byte value. |
void |
sync()
Called to write out any saved buffers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SectionWriter(ImgFileWriter writer, Section section)
Method Detail |
---|
public void sync() throws java.io.IOException
ImgFileWriter
sync
in interface ImgFileWriter
java.io.IOException
- If there is an error writing.public void close()
close
in interface java.io.Closeable
public int position()
ImgFileWriter
position
in interface ImgFileWriter
public void position(long pos)
ImgFileWriter
position
in interface ImgFileWriter
pos
- The new position in the file.public void put(byte b)
ImgFileWriter
put
in interface ImgFileWriter
b
- The byte to write.public void putChar(char c)
ImgFileWriter
putChar
in interface ImgFileWriter
c
- The value to write.public void put3(int val)
ImgFileWriter
put3
in interface ImgFileWriter
val
- The value to write, only the bottom three bytes will be
written.public void putInt(int val)
ImgFileWriter
putInt
in interface ImgFileWriter
val
- The value to write.public void put(byte[] val)
ImgFileWriter
put
in interface ImgFileWriter
val
- The values to write.public void put(byte[] src, int start, int length)
ImgFileWriter
put
in interface ImgFileWriter
src
- The array to take bytes from.start
- The start position.length
- The number of bytes to write.public long getSize()
ImgFileWriter
getSize
in interface ImgFileWriter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |