Package de.fhkn.in.uce.stun.util

Examples of de.fhkn.in.uce.stun.util.MessageFormatException


        return ByteBuffer.allocate(length).putInt(xoredIp).array();
    }

    private static void checkLeadingZeros(final int leadingZeroBits) throws MessageFormatException {
        if (leadingZeroBits != 0) {
            throw new MessageFormatException("Wrong message format, the leading zeros were " + leadingZeroBits); //$NON-NLS-1$
        }
    }
View Full Code Here


        if (ipFamilyBits == IPV4_FAMILY) {
            bytesForIp = new byte[4];
        } else if (ipFamilyBits == IPV6_FAMILY) {
            bytesForIp = new byte[16];
        } else {
            throw new MessageFormatException("Unknown address family " + ipFamilyBits); //$NON-NLS-1$
        }
        return bytesForIp;
    }
View Full Code Here

        final int leading32Bits = din.readInt();
        // leading zeros
        final int leadingZeroBits = leading32Bits & LEADING_ZEROS_MASK;
        if (leadingZeroBits != 0) {
            throw new MessageFormatException("Wrong message format, the leading zeros were " + leadingZeroBits); //$NON-NLS-1$
        }
        // error class
        @SuppressWarnings("unused")
        final int errorClassBits = (leading32Bits & ERROR_CLASS_MASK) >> ERROR_CLASS_SHIFT;
        // error code
View Full Code Here

    private void checkHeaderLength(final byte[] encodedHeader) throws MessageFormatException {
        if (encodedHeader == null) {
            throw new NullPointerException();
        } else if (encodedHeader.length != AttributeHeader.HEADER_LENGTH) {
            throw new MessageFormatException("Header has not the expected length"); //$NON-NLS-1$
        }
    }
View Full Code Here

        return new ChangedAddress(new InetSocketAddress(address, port));
    }

    private static void checkLeadingZeros(final int leadingZeroBits) throws MessageFormatException {
        if (leadingZeroBits != 0) {
            throw new MessageFormatException("Wrong message format, the leading zeros were " + leadingZeroBits); //$NON-NLS-1$
        }
    }
View Full Code Here

        if (ipFamilyBits == IPV4_FAMILY) {
            bytesForIp = new byte[4];
        } else if (ipFamilyBits == IPV6_FAMILY) {
            bytesForIp = new byte[16];
        } else {
            throw new MessageFormatException("Unknown address family " + ipFamilyBits); //$NON-NLS-1$
        }
        return bytesForIp;
    }
View Full Code Here

        return new MappedAddress(new InetSocketAddress(address, port));
    }

    private static void checkLeadingZeros(final int leadingZeroBits) throws MessageFormatException {
        if (leadingZeroBits != 0) {
            throw new MessageFormatException("Wrong message format, the leading zeros were " + leadingZeroBits); //$NON-NLS-1$
        }
    }
View Full Code Here

        if (ipFamilyBits == IPV4_FAMILY) {
            bytesForIp = new byte[4];
        } else if (ipFamilyBits == IPV6_FAMILY) {
            bytesForIp = new byte[16];
        } else {
            throw new MessageFormatException("Unknown address family " + ipFamilyBits); //$NON-NLS-1$
        }
        return bytesForIp;
    }
View Full Code Here

        return new SourceAddress(new InetSocketAddress(address, port));
    }

    private static void checkLeadingZeros(final int leadingZeroBits) throws MessageFormatException {
        if (leadingZeroBits != 0) {
            throw new MessageFormatException("Wrong message format, the leading zeros were " + leadingZeroBits); //$NON-NLS-1$
        }
    }
View Full Code Here

        if (ipFamilyBits == IPV4_FAMILY) {
            bytesForIp = new byte[4];
        } else if (ipFamilyBits == IPV6_FAMILY) {
            bytesForIp = new byte[16];
        } else {
            throw new MessageFormatException("Unknown address family " + ipFamilyBits); //$NON-NLS-1$
        }
        return bytesForIp;
    }
View Full Code Here

TOP

Related Classes of de.fhkn.in.uce.stun.util.MessageFormatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.