Skip to content

msekoranja/pvDataNativeJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pvDataNativeJava

This project implements pvData serialization using POJOs, instead of pvData PV container classes. pvData introspection interface classes and mechanism where replaced by using Java Reflection API.

Usage:

  • first define a simple Java POJO class:
public static class MyData
{
	double x, y;
	String name;
	int[] numbers;
}
  • create a new instance and initialze data
	MyData data = new MyData();
	data.x = 12.3;
	data.y = 4.56;
	data.name = "Matej";
	data.numbers = new int[] { 1, 2, 8 };
  • serialize into a buffer
	ByteBuffer buffer = ByteBuffer.allocate(1024);
	PVData.serialize(buffer, data);
  • deserialize (from the same buffer in this example)
	buffer.flip();
	MyData data2 = PVData.deserialize(buffer, MyData.class);

See full example code.

About

Implementation of pvData serialization using POJOs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages