171a684d2c237c84137c4e51965fd3a2f47ad87b
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / util / BinContent.java
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.openflowjava.protocol.api.util;
10
11 /**
12  * @author michal.polkorab
13  *
14  */
15 public abstract class BinContent {
16
17     /**
18      * @param value
19      * @return int part wrapped in long
20      */
21     public static long intToUnsignedLong(int value) {
22         return value & 0x00000000ffffffffL;
23     }
24     
25     /**
26      * @param value
27      * @return long cut into int
28      */
29     public static int longToSignedInt(long value) {
30         return (int) value;
31     }
32 }