use of org.terasology.persistence.typeHandling.inMemory.PersistedBytes in project Terasology by MovingBlocks.
the class BytesTypeHandlerTest method byteArraySerializeDeserialize.
@Test
void byteArraySerializeDeserialize() {
byte[] expectedObj = new byte[] { (byte) 0xFF };
PersistedBytes data = serialize(expectedObj, new ByteArrayTypeHandler());
Assertions.assertEquals(expectedObj, data.getAsBytes());
byte[] obj = deserialize(data, new ByteArrayTypeHandler());
Assertions.assertEquals(expectedObj, obj);
}
use of org.terasology.persistence.typeHandling.inMemory.PersistedBytes in project Terasology by MovingBlocks.
the class BytesTypeHandlerTest method byteSerializeDeserialize.
@Test
void byteSerializeDeserialize() {
byte expectedObj = (byte) 0xFF;
PersistedBytes data = serialize(expectedObj, new ByteTypeHandler());
Assertions.assertEquals(expectedObj, data.getAsBytes()[0]);
byte obj = deserialize(data, new ByteTypeHandler());
Assertions.assertEquals(expectedObj, obj);
}
Aggregations