blob: 34d54ca22cc694501de32729e1c86d27d57e1169 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
package org.shedlang.compiler.patio.serialization;
import org.shedlang.compiler.patio.PatioCompilationUnit;
import org.shedlang.compiler.patio.PatioCompilationUnitElement;
import org.shedlang.compiler.patio.instructions.PatioInstruction;
import org.shedlang.compiler.patio.operands.PatioOperand;
import org.shedlang.compiler.patio.types.PatioDataLayout;
import org.shedlang.compiler.patio.types.PatioDataValue;
import org.shedlang.compiler.patio.types.PatioType;
import org.shedlang.compiler.patio.values.PatioDataPtrValue;
import org.shedlang.compiler.patio.values.PatioIntValue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public class PatioToTransient0Tests extends PatioSerializationTests {
@Override
protected byte[] serializeCompilationUnit(PatioCompilationUnit value) throws IOException {
var outputStream = new ByteArrayOutputStream();
PatioToTransient0.serializeCompilationUnit(value, outputStream);
return outputStream.toByteArray();
}
@Override
protected PatioCompilationUnit deserializeCompilationUnit(byte[] buffer) throws IOException {
return PatioToTransient0.deserializeCompilationUnit(new ByteArrayInputStream(buffer));
}
@Override
protected byte[] serializeCompilationUnitElement(PatioCompilationUnitElement value) throws IOException {
var outputStream = new ByteArrayOutputStream();
PatioToTransient0.serializeCompilationUnitElement(value, outputStream);
return outputStream.toByteArray();
}
@Override
protected PatioCompilationUnitElement deserializeCompilationUnitElement(byte[] buffer) throws IOException {
return PatioToTransient0.deserializeCompilationUnitElement(new ByteArrayInputStream(buffer));
}
@Override
protected byte[] serializeInstruction(PatioInstruction value) throws IOException {
var outputStream = new ByteArrayOutputStream();
PatioToTransient0.serializeInstruction(value, outputStream);
return outputStream.toByteArray();
}
@Override
protected PatioInstruction deserializeInstruction(byte[] buffer) throws IOException {
return PatioToTransient0.deserializeInstruction(new ByteArrayInputStream(buffer));
}
@Override
protected byte[] serializeOperand(PatioOperand value) throws IOException {
var outputStream = new ByteArrayOutputStream();
PatioToTransient0.serializeOperand(value, outputStream);
return outputStream.toByteArray();
}
@Override
protected PatioOperand deserializeOperand(byte[] buffer) throws IOException {
return PatioToTransient0.deserializeOperand(new ByteArrayInputStream(buffer));
}
@Override
protected byte[] serializeDataPtrValue(PatioDataPtrValue value) throws IOException {
var outputStream = new ByteArrayOutputStream();
PatioToTransient0.serializeDataPtrValue(value, outputStream);
return outputStream.toByteArray();
}
@Override
protected PatioDataPtrValue deserializeDataPtrValue(byte[] buffer) throws IOException {
return PatioToTransient0.deserializeDataPtrValue(new ByteArrayInputStream(buffer));
}
@Override
protected byte[] serializeIntValue(PatioIntValue value) throws IOException {
var outputStream = new ByteArrayOutputStream();
PatioToTransient0.serializeIntValue(value, outputStream);
return outputStream.toByteArray();
}
@Override
protected PatioIntValue deserializeIntValue(byte[] buffer) throws IOException {
return PatioToTransient0.deserializeIntValue(new ByteArrayInputStream(buffer));
}
@Override
protected byte[] serializeType(PatioType value) throws IOException {
var outputStream = new ByteArrayOutputStream();
PatioToTransient0.serializeType(value, outputStream);
return outputStream.toByteArray();
}
@Override
protected PatioType deserializeType(byte[] buffer) throws IOException {
return PatioToTransient0.deserializeType(new ByteArrayInputStream(buffer));
}
@Override
protected byte[] serializeDataLayout(PatioDataLayout value) throws IOException {
var outputStream = new ByteArrayOutputStream();
PatioToTransient0.serializeDataLayout(value, outputStream);
return outputStream.toByteArray();
}
@Override
protected PatioDataLayout deserializeDataLayout(byte[] buffer) throws IOException {
return PatioToTransient0.deserializeDataLayout(new ByteArrayInputStream(buffer));
}
@Override
protected byte[] serializeDataValue(PatioDataValue value) throws IOException {
var outputStream = new ByteArrayOutputStream();
PatioToTransient0.serializeDataValue(value, outputStream);
return outputStream.toByteArray();
}
@Override
protected PatioDataValue deserializeDataValue(byte[] buffer) throws IOException {
return PatioToTransient0.deserializeDataValue(new ByteArrayInputStream(buffer));
}
}
|