
net.razorvine.serpent.ast.BytesNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of serpent Show documentation
Show all versions of serpent Show documentation
Serpent serializes an object tree into a Python ast.literal_eval() compatible literal expression. It is safe to send serpent data to other machines over the network for instance
(because only 'safe' literals are encoded).
There is also a deserializer or parse provided that turns such a literal expression back into the appropriate Java object tree.
It is an alternative to JSON to provide easy data integration between Java and Python. Serpent is more expressive as JSON (it supports more data types).
The newest version!
package net.razorvine.serpent.ast;
import java.util.List;
public class BytesNode extends PrimitiveNode>
{
public BytesNode(List value)
{
super(value);
}
@Override
public void accept(INodeVisitor visitor)
{
visitor.visit(this);
}
public byte[] toByteArray() {
byte[] bytes = new byte[value.size()];
for(int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy