public class ReadRecord extends AbstractRecord
nsResolver, resolver
Constructor and Description |
---|
ReadRecord(String journalId,
String producerId,
long revision,
DataInputStream dataIn,
int length,
NamespaceResolver resolver,
NamePathResolver npResolver)
Create a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelUpdate()
Cancel the changes made to an appended record.
|
void |
close()
Close this record, eventually skipping unconsumed bytes.
|
String |
getJournalId()
Return this record's journal identifier.
|
String |
getProducerId()
Return this record's producer identifier.
|
long |
getRevision()
Returns the revision this record represents.
|
boolean |
readBoolean()
Read a boolean from the underlying stream.
|
byte |
readByte()
Read a byte from the underlying stream.
|
char |
readChar()
Read a character from the underlying stream.
|
void |
readFully(byte[] b)
Fully read an array of bytes from the underlying stream.
|
int |
readInt()
Read an integer from the underlying stream.
|
long |
readLong()
Read a long from the underlying stream.
|
String |
readString()
Read a string from the underlying stream.
|
long |
update()
Update the changes made to an appended record.
|
void |
write(byte[] b)
Write an array of bytes to the underlying stream.
|
void |
writeBoolean(boolean b)
Write a boolean from the underlying stream.
|
void |
writeByte(int n)
Unsupported methods when appending.
|
void |
writeChar(char c)
Write a character to the underlying stream.
|
void |
writeInt(int n)
Write an integer to the underlying stream.
|
void |
writeLong(long n)
Write a long to the underlying stream.
|
void |
writeQName(Name name)
Write a
Name to the underlying stream. |
void |
writeString(String s)
Write a string to the underlying stream.
|
readNodeId, readNodeTypeDef, readPath, readPathElement, readPrivilegeDef, readPropertyId, readQName, writeNodeId, writeNodeTypeDef, writePath, writePathElement, writePrivilegeDef, writePropertyId
public ReadRecord(String journalId, String producerId, long revision, DataInputStream dataIn, int length, NamespaceResolver resolver, NamePathResolver npResolver)
public String getJournalId()
public String getProducerId()
public long getRevision()
public byte readByte() throws JournalException
JournalException
- if an error occurspublic char readChar() throws JournalException
JournalException
- if an error occurspublic boolean readBoolean() throws JournalException
JournalException
- if an error occurspublic int readInt() throws JournalException
JournalException
- if an error occurspublic long readLong() throws JournalException
JournalException
- if an error occurspublic String readString() throws JournalException
null
JournalException
- if an error occurspublic void readFully(byte[] b) throws JournalException
b
- byte arrayJournalException
- if an error occurspublic void close() throws IOException
IOException
- if an I/O error occurspublic void writeByte(int n) throws JournalException
n
- byteJournalException
- if an error occurspublic void writeChar(char c) throws JournalException
Record
c
- characterJournalException
- if an error occurspublic void writeBoolean(boolean b) throws JournalException
Record
b
- booleanJournalException
- if an error occurspublic void writeInt(int n) throws JournalException
Record
n
- integerJournalException
- if an error occurspublic void writeLong(long n) throws JournalException
Record
n
- longJournalException
- if an error occurspublic void writeString(String s) throws JournalException
Record
s
- string, may be null
JournalException
- if an error occurspublic void writeQName(Name name) throws JournalException
AbstractRecord
Name
to the underlying stream.writeQName
in interface Record
writeQName
in class AbstractRecord
name
- nameJournalException
- if an error occurspublic void write(byte[] b) throws JournalException
Record
b
- byte arrayJournalException
- if an error occurspublic long update() throws JournalException
Record
JournalException
- if this record has not been appended,
or if another error occurspublic void cancelUpdate()
Record
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.