|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.core.archive.compound.ArchiveEntry
public abstract class ArchiveEntry
the user must close the archive
Field Summary | |
---|---|
protected byte[] |
buffer
the read writer buffer |
protected boolean |
buffer_dirty
if the buffer is write buffer |
protected int |
buffer_offset
the current point in the buffer |
protected int |
buffer_size
the data size in the buffer |
protected long |
offset
the offset of the first byte of buffer in the file |
Constructor Summary | |
---|---|
ArchiveEntry()
|
Method Summary | |
---|---|
protected abstract void |
_flush()
|
protected abstract long |
_getLength()
|
protected abstract void |
_refresh()
|
protected abstract void |
_setLength(long length)
|
abstract void |
close()
|
protected void |
discardBuffer()
ignore the buffer by reset the buffer offset and buffer size |
void |
flush()
flush the data into the disk |
protected void |
flushBuffer()
flush the data into the buffer and move the buffer to next position. |
long |
getLength()
get the length of the entry. |
abstract java.lang.String |
getName()
|
long |
getPosition()
return the file position. |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
abstract int |
read(long offset,
byte[] b,
int off,
int size)
|
int |
readInt()
|
long |
readLong()
|
void |
refresh()
reload the data from the disk. |
protected void |
refreshBuffer(int minSize)
|
protected void |
saveBuffer()
save the changed buffer into disk |
void |
seek(long off)
set the file position to offset if the file position exceed the file length, the EOF exception is throw out in next read. |
void |
setLength(long length)
set the length to the entry |
void |
write(byte[] b,
int off,
int len)
write byte[] at the current position. |
void |
write(int b)
write the data at the current position. |
abstract void |
write(long offset,
byte[] b,
int off,
int size)
|
void |
writeInt(int v)
write a integer at the current position. |
void |
writeLong(long v)
write a long at the current position. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long offset
protected byte[] buffer
protected boolean buffer_dirty
protected int buffer_offset
protected int buffer_size
Constructor Detail |
---|
public ArchiveEntry()
Method Detail |
---|
public abstract java.lang.String getName() throws java.io.IOException
java.io.IOException
protected abstract long _getLength() throws java.io.IOException
java.io.IOException
protected abstract void _setLength(long length) throws java.io.IOException
java.io.IOException
protected abstract void _flush() throws java.io.IOException
java.io.IOException
protected abstract void _refresh() throws java.io.IOException
java.io.IOException
public abstract int read(long offset, byte[] b, int off, int size) throws java.io.IOException
java.io.IOException
public abstract void write(long offset, byte[] b, int off, int size) throws java.io.IOException
java.io.IOException
public abstract void close() throws java.io.IOException
java.io.IOException
public final long getLength() throws java.io.IOException
java.io.IOException
public final void setLength(long length) throws java.io.IOException
length
-
java.io.IOException
public final void flush() throws java.io.IOException
java.io.IOException
public final void refresh() throws java.io.IOException
java.io.IOException
public final void seek(long off) throws java.io.IOException
off
- the file position
java.io.IOException
public final long getPosition() throws java.io.IOException
java.io.IOException
public final void write(int b) throws java.io.IOException
b
-
java.io.IOException
public final void writeInt(int v) throws java.io.IOException
v
-
java.io.IOException
public final void writeLong(long v) throws java.io.IOException
v
-
java.io.IOException
public final void write(byte[] b, int off, int len) throws java.io.IOException
b
- off
- len
-
java.io.IOException
public final int read() throws java.io.IOException
java.io.IOException
public final int readInt() throws java.io.IOException
java.io.IOException
public final long readLong() throws java.io.IOException
java.io.IOException
public final int read(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
protected void discardBuffer() throws java.io.IOException
java.io.IOException
protected void saveBuffer() throws java.io.IOException
java.io.IOException
protected void flushBuffer() throws java.io.IOException
java.io.IOException
protected void refreshBuffer(int minSize) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |