Modifier and Type | Field and Description |
---|---|
protected byte[] |
blockBytes |
protected org.agilewiki.jid.ReadableBytes |
rb |
protected byte[] |
rootJidBytes |
Constructor and Description |
---|
LBlock() |
Modifier and Type | Method and Description |
---|---|
long |
getCurrentPosition()
Returns the file position.
|
String |
getFileName()
Returns the file name.
|
org.agilewiki.jid.scalar.vlens.actor.RootJid |
getRootJid()
Get an existing RootJid.
|
org.agilewiki.jid.scalar.vlens.actor.RootJid |
getRootJid(org.agilewiki.jactor.Mailbox mailbox,
org.agilewiki.jactor.Actor parent)
Return the RootJid, deserializing it as needed..
|
long |
getTimestamp()
Returns the timestamp.
|
int |
headerLength()
The length of the header which prefaces the actual data on disk.
|
boolean |
isEmpty()
Indicates the abscense of a root jic.
|
protected void |
saveHeader(org.agilewiki.jid.AppendableBytes ab,
int l)
Provides the raw header information to be written to disk.
|
byte[] |
serialize()
Serializes the header and the assigned RootJid.
|
void |
setCurrentPosition(long position)
Assigns the files current position.
|
void |
setFileName(String fileName)
Assigns the file's name.
|
int |
setHeaderBytes(byte[] bytes)
Provides the raw header information read from disk.
|
void |
setRootJid(org.agilewiki.jid.scalar.vlens.actor.RootJid rootJid)
Reset the block and assign the RootJid.
|
boolean |
setRootJidBytes(byte[] rootJidBytes)
Provides the data read from disk after the header.
|
void |
setTimestamp(long timestamp)
Assigns the timestamp.
|
protected org.agilewiki.jid.ReadableBytes rb
protected byte[] blockBytes
protected byte[] rootJidBytes
public void setRootJid(org.agilewiki.jid.scalar.vlens.actor.RootJid rootJid)
setRootJid
in interface Block
rootJid
- The RootJid to be assigned.public byte[] serialize() throws Exception
protected void saveHeader(org.agilewiki.jid.AppendableBytes ab, int l) throws Exception
ab
- Append the data to this.l
- The length of the data.Exception
public int headerLength()
headerLength
in interface Block
public String getFileName()
getFileName
in interface Block
public void setFileName(String fileName)
setFileName
in interface Block
public long getCurrentPosition()
getCurrentPosition
in interface Block
public void setCurrentPosition(long position)
setCurrentPosition
in interface Block
public int setHeaderBytes(byte[] bytes)
setHeaderBytes
in interface Block
bytes
- The header bytes read from disk.public boolean setRootJidBytes(byte[] rootJidBytes)
setRootJidBytes
in interface Block
rootJidBytes
- The data following the header on disk.public org.agilewiki.jid.scalar.vlens.actor.RootJid getRootJid() throws Exception
getRootJid
in interface Block
Exception
- An exception is thrown when there is no RootJid.public org.agilewiki.jid.scalar.vlens.actor.RootJid getRootJid(org.agilewiki.jactor.Mailbox mailbox, org.agilewiki.jactor.Actor parent) throws Exception
getRootJid
in interface Block
mailbox
- The mailbox.parent
- The parent.Exception
public boolean isEmpty()
public long getTimestamp()
getTimestamp
in interface Block
public void setTimestamp(long timestamp)
setTimestamp
in interface Block
timestamp
- The timestamp.Copyright © 2013. All Rights Reserved.