Here you can find the source of complementingOrder(ByteOrder order)
Parameter | Description |
---|---|
order | The ByteOrder to complement - ignored if <code>null</code> |
null
if no argument to complement)
public static final ByteOrder complementingOrder(ByteOrder order)
//package com.java2s; /*//w w w . j av a 2 s. c o m * Copyright 2013 Lyor Goldstein * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.nio.ByteOrder; public class Main { /** * @return The complement of the current byte order * @see ByteOrder#nativeOrder() * @see #complementingOrder(ByteOrder) */ public static final ByteOrder complementingOrder() { return complementingOrder(ByteOrder.nativeOrder()); } /** * @param order The {@link ByteOrder} to complement - ignored if <code>null</code> * @return The complement {@link ByteOrder} (or <code>null</code> if no * argument to complement) */ public static final ByteOrder complementingOrder(ByteOrder order) { if (order == null) { return null; } else if (ByteOrder.BIG_ENDIAN.equals(order)) { return ByteOrder.LITTLE_ENDIAN; } else { return ByteOrder.BIG_ENDIAN; } } }