2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.pcep.ietf;
10 import static org.junit.Assert.assertArrayEquals;
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.fail;
14 import io.netty.buffer.ByteBuf;
15 import io.netty.buffer.Unpooled;
16 import org.junit.Test;
17 import org.opendaylight.protocol.pcep.ietf.stateful07.PathBindingTlvParser;
18 import org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07LSPIdentifierIpv4TlvParser;
19 import org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07LSPIdentifierIpv6TlvParser;
20 import org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07LspSymbolicNameTlvParser;
21 import org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07LspUpdateErrorTlvParser;
22 import org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07RSVPErrorSpecTlvParser;
23 import org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07StatefulCapabilityTlvParser;
24 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
25 import org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsCapabilityTlvParser;
26 import org.opendaylight.protocol.util.ByteArray;
27 import org.opendaylight.protocol.util.Ipv4Util;
28 import org.opendaylight.protocol.util.Ipv6Util;
29 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
32 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.lsp.error.code.tlv.LspErrorCode;
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.lsp.error.code.tlv.LspErrorCodeBuilder;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.lsp.identifiers.tlv.LspIdentifiers;
35 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.lsp.identifiers.tlv.LspIdentifiersBuilder;
36 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.lsp.identifiers.tlv.lsp.identifiers.address.family.Ipv4CaseBuilder;
37 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.lsp.identifiers.tlv.lsp.identifiers.address.family.Ipv6CaseBuilder;
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv4._case.Ipv4Builder;
39 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6Builder;
40 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.path.binding.tlv.PathBinding;
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.path.binding.tlv.PathBindingBuilder;
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.path.binding.tlv.path.binding.binding.type.value.MplsLabelBuilder;
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.path.binding.tlv.path.binding.binding.type.value.MplsLabelEntryBuilder;
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.rsvp.error.spec.tlv.RsvpErrorSpec;
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.rsvp.error.spec.tlv.RsvpErrorSpecBuilder;
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.rsvp.error.spec.tlv.rsvp.error.spec.error.type.RsvpCaseBuilder;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.rsvp.error.spec.tlv.rsvp.error.spec.error.type.UserCaseBuilder;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.rsvp.error.spec.tlv.rsvp.error.spec.error.type.rsvp._case.RsvpErrorBuilder;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.rsvp.error.spec.tlv.rsvp.error.spec.error.type.user._case.UserErrorBuilder;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.stateful.capability.tlv.Stateful;
51 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.stateful.capability.tlv.StatefulBuilder;
52 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.symbolic.path.name.tlv.SymbolicPathName;
53 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109.symbolic.path.name.tlv.SymbolicPathNameBuilder;
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.Ipv4ExtendedTunnelId;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.Ipv6ExtendedTunnelId;
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId;
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.TunnelId;
59 public class PCEPTlvParserTest {
61 private static final byte[] STATEFUL_BYTES = { 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01 };
62 private static final byte[] STATEFUL_SYNC_OPT_BYTES = new byte[]{ 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x33 };
63 private static final byte[] SYMBOLIC_NAME_BYTES = {
64 0x00, 0x11, 0x00, 0x1C, 0x4d, 0x65, 0x64, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x6f,
65 0x66, 0x20, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x69, 0x63, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x65, 0x65, 0x65
67 private static final byte[] LSP_UPDATE_ERROR_BYTES = { 0x00, 0x14, 0x00, 0x04, 0x25, 0x68, (byte) 0x95, 0x03 };
68 private static final byte[] LSP_IDENTIFIERS4_BYTES = {
69 0x00, 0x12, 0x00, 0x10, 0x12, 0x34, 0x56, 0x78, (byte) 0xFF, (byte) 0xFF, 0x12,
70 0x34, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78
72 private static final byte[] LSP_IDENTIFIERS6_BYTES = {
73 0x00, 0x13, 0x00, 0x34, 0x12, 0x34, 0x56, 0x78, (byte) 0x9A, (byte) 0xBC,
74 (byte) 0xDE, (byte) 0xF0, 0x12, 0x34, 0x56, 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0, 0x12,
75 0x34, (byte) 0xFF, (byte) 0xFF, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x01, 0x23, 0x45, 0x67, 0x01,
76 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0, 0x12, 0x34, 0x56,
77 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0
79 private static final byte[] RSVP_ERROR_BYTES = {
80 0x00, 0x15, 0x00, 0x0c, 0, 0x0c, 0x06, 0x01, 0x12, 0x34, 0x56, 0x78, 0x02, (byte) 0x92, 0x16, 0x02
82 private static final byte[] RSVP_ERROR6_BYTES = {
83 0x00, 0x15, 0x00, 0x18, 0, 0x18, 0x06, 0x02, 0x12, 0x34, 0x56, 0x78, (byte) 0x9a, (byte) 0xbc, (byte) 0xde,
84 (byte) 0xf0, 0x12, 0x34, 0x56, 0x78, (byte) 0x9a, (byte) 0xbc, (byte) 0xde, (byte) 0xf0, 0x02, (byte) 0xd5,
85 (byte) 0xc5, (byte) 0xd9
87 private static final byte[] USER_ERROR_BYTES = {
88 0x00, 0x15, 0x00, 0x18, 0, 0x18, (byte) 0xc2, 0x01, 0x00, 0x00, 0x30, 0x39, 0x05, 0x09, 0x00,
89 0x26, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x65, 0x73, 0x63, 0, 0, 0
93 public void testStatefulTlv() throws PCEPDeserializerException {
94 final Stateful07StatefulCapabilityTlvParser parser = new Stateful07StatefulCapabilityTlvParser();
95 final Stateful tlv = new StatefulBuilder().setLspUpdateCapability(Boolean.TRUE).build();
96 assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(STATEFUL_BYTES, 4))));
97 final ByteBuf buff = Unpooled.buffer();
98 parser.serializeTlv(tlv, buff);
99 assertArrayEquals(STATEFUL_BYTES, ByteArray.getAllBytes(buff));
103 public void testStatefulTlvSyncOptimizationExtension() throws PCEPDeserializerException {
104 final SyncOptimizationsCapabilityTlvParser parser = new SyncOptimizationsCapabilityTlvParser();
105 final Stateful tlv = new StatefulBuilder().setLspUpdateCapability(Boolean.TRUE)
106 .addAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync
107 .optimizations.rev181109.Stateful1.class, new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml
108 .ns.yang.controller.pcep.sync.optimizations.rev181109.Stateful1Builder()
109 .setTriggeredInitialSync(Boolean.TRUE)
110 .setDeltaLspSyncCapability(Boolean.TRUE)
111 .setIncludeDbVersion(Boolean.TRUE)
114 assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(STATEFUL_SYNC_OPT_BYTES, 4))));
115 final ByteBuf buff = Unpooled.buffer();
116 parser.serializeTlv(tlv, buff);
117 assertArrayEquals(STATEFUL_SYNC_OPT_BYTES, ByteArray.getAllBytes(buff));
121 public void testSymbolicNameTlv() throws PCEPDeserializerException {
122 final Stateful07LspSymbolicNameTlvParser parser = new Stateful07LspSymbolicNameTlvParser();
123 final SymbolicPathName tlv = new SymbolicPathNameBuilder().setPathName(
124 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev181109
125 .SymbolicPathName("Med test of symbolic nameeee".getBytes())).build();
126 assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(SYMBOLIC_NAME_BYTES, 4))));
127 final ByteBuf buff = Unpooled.buffer();
128 parser.serializeTlv(tlv, buff);
129 assertArrayEquals(SYMBOLIC_NAME_BYTES, ByteArray.getAllBytes(buff));
133 public void testLspErrorCodeTlv() throws PCEPDeserializerException {
134 final Stateful07LspUpdateErrorTlvParser parser = new Stateful07LspUpdateErrorTlvParser();
135 final LspErrorCode tlv = new LspErrorCodeBuilder().setErrorCode(627610883L).build();
136 assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(LSP_UPDATE_ERROR_BYTES, 4))));
137 final ByteBuf buff = Unpooled.buffer();
138 parser.serializeTlv(tlv, buff);
139 assertArrayEquals(LSP_UPDATE_ERROR_BYTES, ByteArray.getAllBytes(buff));
143 public void testLspIdentifiers4Tlv() throws PCEPDeserializerException {
144 final Stateful07LSPIdentifierIpv4TlvParser parser = new Stateful07LSPIdentifierIpv4TlvParser();
145 final Ipv4Builder afi = new Ipv4Builder();
146 afi.setIpv4TunnelSenderAddress(Ipv4Util.noZoneAddressForByteBuf(Unpooled.wrappedBuffer(
147 new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 })));
148 afi.setIpv4ExtendedTunnelId(new Ipv4ExtendedTunnelId(Ipv4Util.noZoneAddressForByteBuf(
149 Unpooled.wrappedBuffer(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 }))));
150 afi.setIpv4TunnelEndpointAddress(Ipv4Util.noZoneAddressForByteBuf(Unpooled.wrappedBuffer(
151 new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 })));
152 final LspIdentifiers tlv = new LspIdentifiersBuilder().setAddressFamily(
153 new Ipv4CaseBuilder().setIpv4(afi.build()).build()).setLspId(new LspId(65535L))
154 .setTunnelId(new TunnelId(4660)).build();
155 assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(LSP_IDENTIFIERS4_BYTES, 4))));
156 final ByteBuf buff = Unpooled.buffer();
157 parser.serializeTlv(tlv, buff);
158 assertArrayEquals(LSP_IDENTIFIERS4_BYTES, ByteArray.getAllBytes(buff));
162 public void testLspIdentifiers6Tlv() throws PCEPDeserializerException {
163 final Stateful07LSPIdentifierIpv6TlvParser parser = new Stateful07LSPIdentifierIpv6TlvParser();
164 final Ipv6Builder afi = new Ipv6Builder();
165 afi.setIpv6TunnelSenderAddress(Ipv6Util.noZoneAddressForByteBuf(Unpooled.wrappedBuffer(
167 (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
168 (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
169 (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0
171 afi.setIpv6ExtendedTunnelId(new Ipv6ExtendedTunnelId(Ipv6Util.noZoneAddressForByteBuf(Unpooled.wrappedBuffer(
173 (byte) 0x12, (byte) 0x34, (byte) 0x56,
174 (byte) 0x78, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x01, (byte) 0x23, (byte) 0x45,
175 (byte) 0x67, (byte) 0x01, (byte) 0x23, (byte) 0x45, (byte) 0x67
177 afi.setIpv6TunnelEndpointAddress(Ipv6Util.noZoneAddressForByteBuf(Unpooled.wrappedBuffer(
179 (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
180 (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
181 (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0
183 final LspIdentifiers tlv = new LspIdentifiersBuilder()
184 .setAddressFamily(new Ipv6CaseBuilder().setIpv6(afi.build()).build())
185 .setLspId(new LspId(4660L)).setTunnelId(new TunnelId(65535)).build();
186 assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(LSP_IDENTIFIERS6_BYTES, 4))));
187 final ByteBuf buff = Unpooled.buffer();
188 parser.serializeTlv(tlv, buff);
189 assertArrayEquals(LSP_IDENTIFIERS6_BYTES, ByteArray.getAllBytes(buff));
193 public void testRSVPError4SpecTlv() throws PCEPDeserializerException {
194 final Stateful07RSVPErrorSpecTlvParser parser = new Stateful07RSVPErrorSpecTlvParser();
195 final RsvpErrorBuilder builder = new RsvpErrorBuilder();
196 builder.setNode(new IpAddressNoZone(Ipv4Util.noZoneAddressForByteBuf(Unpooled.wrappedBuffer(
197 new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 }))));
198 builder.setFlags(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.ErrorSpec
199 .Flags(false, true));
200 builder.setCode((short) 146);
201 builder.setValue(5634);
202 final RsvpErrorSpec tlv = new RsvpErrorSpecBuilder()
203 .setErrorType(new RsvpCaseBuilder().setRsvpError(builder.build()).build()).build();
204 assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(RSVP_ERROR_BYTES, 4))));
205 final ByteBuf buff = Unpooled.buffer();
206 parser.serializeTlv(tlv, buff);
207 assertArrayEquals(RSVP_ERROR_BYTES, ByteArray.getAllBytes(buff));
211 public void testRSVPError6SpecTlv() throws PCEPDeserializerException {
212 final Stateful07RSVPErrorSpecTlvParser parser = new Stateful07RSVPErrorSpecTlvParser();
213 final RsvpErrorBuilder builder = new RsvpErrorBuilder();
214 builder.setNode(new IpAddressNoZone(Ipv6Util.noZoneAddressForByteBuf(Unpooled.wrappedBuffer(
216 (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
217 (byte) 0x9a, (byte) 0xbc, (byte) 0xde, (byte) 0xf0, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
218 (byte) 0x9a, (byte) 0xbc, (byte) 0xde, (byte) 0xf0
220 builder.setFlags(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.ErrorSpec
221 .Flags(false, true));
222 builder.setCode((short) 213);
223 builder.setValue(50649);
224 final RsvpErrorSpec tlv = new RsvpErrorSpecBuilder()
225 .setErrorType(new RsvpCaseBuilder().setRsvpError(builder.build()).build()).build();
226 assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(RSVP_ERROR6_BYTES, 4))));
227 final ByteBuf buff = Unpooled.buffer();
228 parser.serializeTlv(tlv, buff);
229 assertArrayEquals(RSVP_ERROR6_BYTES, ByteArray.getAllBytes(buff));
233 public void testUserErrorSpecTlv() throws PCEPDeserializerException {
234 final Stateful07RSVPErrorSpecTlvParser parser = new Stateful07RSVPErrorSpecTlvParser();
235 final UserErrorBuilder builder = new UserErrorBuilder();
236 builder.setEnterprise(new EnterpriseNumber(12345L));
237 builder.setSubOrg((short) 5);
238 builder.setValue(38);
239 builder.setDescription("user desc");
240 final RsvpErrorSpec tlv = new RsvpErrorSpecBuilder()
241 .setErrorType(new UserCaseBuilder().setUserError(builder.build()).build()).build();
242 assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(USER_ERROR_BYTES, 4))));
243 final ByteBuf buff = Unpooled.buffer();
244 parser.serializeTlv(tlv, buff);
245 assertArrayEquals(USER_ERROR_BYTES, ByteArray.getAllBytes(buff));
249 public void testPathBindingTlvMplsLabel() {
250 final byte[] pathBindingBytes = {
251 0x00, 0x1f, 0x00, 0x06, 0x00, 0x00, (byte) 0xA8, 0x0F, (byte) 0x60, 0x00, 0x00, 0x00
253 final PathBindingTlvParser parser = new PathBindingTlvParser();
254 final PathBindingBuilder builder = new PathBindingBuilder();
255 builder.setBindingTypeValue(new MplsLabelBuilder().setMplsLabel(new MplsLabel(688_374L)).build());
256 final ByteBuf buff = Unpooled.buffer();
257 parser.serializeTlv(builder.build(), buff);
258 assertArrayEquals(pathBindingBytes, ByteArray.readAllBytes(buff));
261 final byte[] wrong = {0, 0x1f, 0, 4, 1, 1, 2, 3};
262 parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(wrong, 4)));
264 } catch (final PCEPDeserializerException e) {
265 assertEquals("Unsupported Path Binding Type: 257", e.getMessage());
270 public void testPathBindingTlvMplsLabelEntry() {
271 final byte[] pathBindingBytes = {
272 0x00, 0x1f, 0x00, 0x06, 0x00, 0x01, (byte) 0xA8, (byte) 0x0F, (byte) 0x6D, (byte)0xAD, 0x00, 0x00
274 final PathBindingTlvParser parser = new PathBindingTlvParser();
275 final PathBindingBuilder builder = new PathBindingBuilder();
276 builder.setBindingTypeValue(
277 new MplsLabelEntryBuilder()
278 .setTrafficClass((short) 6)
279 .setTimeToLive((short) 173)
280 .setBottomOfStack(true)
281 .setLabel(new MplsLabel(688_374L)).build());
282 final PathBinding tlv = builder.build();
283 final ByteBuf buff = Unpooled.buffer();
284 parser.serializeTlv(tlv, buff);
285 assertArrayEquals(pathBindingBytes, ByteArray.readAllBytes(buff));