Class BinaryObject
- java.lang.Object
-
- de.bsvrz.puk.config.configFile.fileaccess.BinaryObject
-
- Direct Known Subclasses:
BinaryConfigObject
,BinaryDynamicObject
public abstract class BinaryObject extends java.lang.Object
Binäre Darstellung eines Objekts in der Konfigurationsdatei (ConfigAreaFile
).Diese Klasse bietet einfache Methoden um Objekte aus
DataInput
-Objekten (wie DataInputStreams oderBufferedRandomAccessFile
s) einzulesen und sie wieder zu schreiben.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CONFIG_OBJ_HEADER_SIZE
Größe des Headers fär Konfigurationsobjekte: ID (long), PidHashCode (int), Typ-ID (long), Objekttyp (byte), Ungültig (short), Gültig (short)static int
CONFIGURATION_OBJECT_TYPE
static int
DYN_OBJ_HEADER_SIZE
Größe des Headers fär dynamische Objekte: ID (long), PidHashCode (int), Typ-ID (long), Objekttyp (byte), Ungültig (long), Gültig (long), Simulationsvariante (short)static int
DYNAMIC_OBJECT_TYPE
-
Constructor Summary
Constructors Constructor Description BinaryObject()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static BinaryObject
fromDataInput(java.io.DataInput input)
Liest ein Objekt einabstract long
getObjectId()
Gibt die Objekt-ID zurückabstract byte[]
getPackedBytes()
Gibt die gepackten Bytes zurück.abstract int
getPidHashCode()
Gibt den Pid-Hashcode zurückabstract long
getTypeId()
Gibt die ID des Objekttyps zuückabstract SystemObjectInformation
toSystemObjectInfo(ConfigAreaFile file, long position)
abstract int
write(java.io.DataOutput output)
Schreibt das Objekt in den Ausgabe-Stream
-
-
-
Field Detail
-
CONFIG_OBJ_HEADER_SIZE
public static final int CONFIG_OBJ_HEADER_SIZE
Größe des Headers fär Konfigurationsobjekte: ID (long), PidHashCode (int), Typ-ID (long), Objekttyp (byte), Ungültig (short), Gültig (short)- See Also:
- Constant Field Values
-
DYN_OBJ_HEADER_SIZE
public static final int DYN_OBJ_HEADER_SIZE
Größe des Headers fär dynamische Objekte: ID (long), PidHashCode (int), Typ-ID (long), Objekttyp (byte), Ungültig (long), Gültig (long), Simulationsvariante (short)- See Also:
- Constant Field Values
-
CONFIGURATION_OBJECT_TYPE
public static final int CONFIGURATION_OBJECT_TYPE
- See Also:
- Constant Field Values
-
DYNAMIC_OBJECT_TYPE
public static final int DYNAMIC_OBJECT_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromDataInput
public static BinaryObject fromDataInput(java.io.DataInput input) throws java.io.IOException
Liest ein Objekt ein- Parameters:
input
- Eingabe-Stream oderBufferedRandomAccessFile
, das sich an der richtigen Position befindet. Der Stream befindet sich nach dem Einlesen garantiert an der Position nach dem Objekt (oder der Lücke), wo also ein weiteres Objekt gelesen werden kännte.- Returns:
- Eingelesenes Objekt oder null, wenn sich an dieser Position eine Lücke befindet.
- Throws:
java.io.IOException
-
write
public abstract int write(java.io.DataOutput output) throws java.io.IOException
Schreibt das Objekt in den Ausgabe-Stream- Parameters:
output
- Ausgabe- Returns:
- Anzahl geschriebener Bytes
- Throws:
java.io.IOException
-
getObjectId
public abstract long getObjectId()
Gibt die Objekt-ID zurück- Returns:
- die Objekt-ID oder 0 falls es sich um eine Lücke handelt
-
getPidHashCode
public abstract int getPidHashCode()
Gibt den Pid-Hashcode zurück- Returns:
- den Pid-Hashcode
-
getTypeId
public abstract long getTypeId()
Gibt die ID des Objekttyps zuück- Returns:
- die ID des Objekttyps
-
getPackedBytes
public abstract byte[] getPackedBytes()
Gibt die gepackten Bytes zurück. Die gepackten Bytes enthalten weitere Objektinformationen wie die Name, Pid, Konfigurationsdaten usw.- Returns:
- die gepackten Bytes
-
toSystemObjectInfo
public abstract SystemObjectInformation toSystemObjectInfo(ConfigAreaFile file, long position) throws java.io.IOException, de.bsvrz.sys.funclib.dataSerializer.NoSuchVersionException
- Throws:
java.io.IOException
de.bsvrz.sys.funclib.dataSerializer.NoSuchVersionException
-
-