public enum IndexExternalizer extends Enum<IndexExternalizer> implements Externalizer<Integer>
Enum Constant and Description |
---|
INTEGER |
UNSIGNED_BYTE |
UNSIGNED_SHORT |
VARIABLE
Reads/write an unsigned integer using a variable-length format.
|
Modifier and Type | Method and Description |
---|---|
Class<? extends Integer> |
getTargetClass()
Returns the target class of the object to externalize.
|
abstract int |
readData(DataInput input)
Read an index from the specified input stream.
|
Integer |
readObject(ObjectInput input)
Read an instance from the stream.
|
static IndexExternalizer |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IndexExternalizer[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
abstract void |
writeData(DataOutput output,
int index)
Writes the specified index to the specified output stream
|
void |
writeObject(ObjectOutput output,
Integer index)
Writes the object reference to the stream.
|
public static final IndexExternalizer UNSIGNED_BYTE
public static final IndexExternalizer UNSIGNED_SHORT
public static final IndexExternalizer INTEGER
public static final IndexExternalizer VARIABLE
public static IndexExternalizer[] values()
for (IndexExternalizer c : IndexExternalizer.values()) System.out.println(c);
public static IndexExternalizer valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic abstract int readData(DataInput input) throws IOException
input
- a data input streamIOException
- if an I/O error occurspublic abstract void writeData(DataOutput output, int index) throws IOException
output
- the data output streamindex
- the indexIOException
- if an I/O error occurspublic Integer readObject(ObjectInput input) throws IOException, ClassNotFoundException
Externalizer
Externalizer.writeObject(ObjectOutput, Object)
method. Implementations are free
to create instances of the object read from the stream in any way that they
feel like. This could be via constructor, factory or reflection.readObject
in interface Externalizer<Integer>
input
- the object input from which to readIOException
- if an I/O error occursClassNotFoundException
- if a class could not be foundpublic void writeObject(ObjectOutput output, Integer index) throws IOException
Externalizer
writeObject
in interface Externalizer<Integer>
output
- the object output to write toindex
- the object reference to writeIOException
- if an I/O error occurspublic Class<? extends Integer> getTargetClass()
Externalizer
getTargetClass
in interface Externalizer<Integer>
Copyright © 2018 JBoss by Red Hat. All rights reserved.