mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-26 06:53:01 +00:00
25 lines
545 B
Java
25 lines
545 B
Java
package mcp.mobius.opis.data.holders;
|
|
|
|
import java.io.DataInputStream;
|
|
import java.io.DataOutputStream;
|
|
import java.io.IOException;
|
|
|
|
public class SerializableInt implements ISerializable {
|
|
|
|
public int value = 0;
|
|
|
|
public SerializableInt(int value){
|
|
this.value = value;
|
|
}
|
|
|
|
@Override
|
|
public void writeToStream(DataOutputStream stream) throws IOException {
|
|
stream.writeInt(this.value);
|
|
}
|
|
|
|
public static SerializableInt readFromStream(DataInputStream stream) throws IOException {
|
|
return new SerializableInt(stream.readInt());
|
|
}
|
|
|
|
}
|