2 * Copyright (c) 2016 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.yangtools.concepts;
10 import com.google.common.annotations.Beta;
11 import java.io.DataOutput;
12 import java.io.IOException;
13 import javax.annotation.Nonnull;
16 * Marker interface for an object which can be written out to an {@link DataOutput}. Classes implementing this
17 * interface should declare a corresponding
20 * public static CLASS readFrom(DataInput in) throws IOException;
23 * The serialization format provided by this abstraction does not guarantee versioning. Callers are responsible for
24 * ensuring the source stream is correctly positioned.
26 * @author Robert Varga
29 public interface WritableObject {
31 * Serialize this object into a {@link DataOutput} as a fixed-format stream.
33 * @param out Data output
34 * @throws IOException if an I/O error occurs
35 * @throws NullPointerException if out is null
37 void writeTo(@Nonnull DataOutput out) throws IOException;