Package org.apache.directory.api.ldap.model.entry

Examples of org.apache.directory.api.ldap.model.entry.BinaryValue


    {
        byte[] v1 = Strings.getBytesUtf8( "test" );
        byte[] v1Norm = Strings.getBytesUtf8( "test" );

        // First check with a value which will be normalized
        BinaryValue sbv = new BinaryValue( at, v1 );

        sbv.apply( at );
        byte[] normalized = sbv.getNormReference();

        assertTrue( Arrays.equals( v1Norm, normalized ) );
        assertTrue( Arrays.equals( v1, sbv.getBytes() ) );

        BinaryValue sbvSer = deserializeValue( serializeValue( sbv ), at );

        assertEquals( sbv, sbvSer );
    }
View Full Code Here


                    for ( byte b : val )
                    {
                        newVal[i++] = ( byte ) ( b & 0x007F );
                    }

                    return new BinaryValue( Strings.trim( newVal ) );
                }

                throw new IllegalStateException( I18n.err( I18n.ERR_04475 ) );
            }
View Full Code Here

                    for ( byte b : val )
                    {
                        newVal[i++] = ( byte ) ( b & 0x007F );
                    }

                    return new BinaryValue( Strings.trim( newVal ) );
                }

                throw new IllegalStateException( "expected byte[] to normalize" );
            }
View Full Code Here

        ObjectInputStream in = null;

        byte[] data = baos.toByteArray();
        in = new ObjectInputStream( new ByteArrayInputStream( data ) );

        BinaryValue bvDeser = new BinaryValue( ( AttributeType ) null );
        bvDeser.readExternal( in );

        assertEquals( bv1, bvDeser );
    }
View Full Code Here

        ObjectInputStream in = null;

        byte[] data = baos.toByteArray();
        in = new ObjectInputStream( new ByteArrayInputStream( data ) );

        BinaryValue bvDeser = new BinaryValue( ( AttributeType ) null );
        bvDeser.readExternal( in );

        assertEquals( bv2, bvDeser );
    }
View Full Code Here

        ObjectInputStream in = null;

        byte[] data = baos.toByteArray();
        in = new ObjectInputStream( new ByteArrayInputStream( data ) );

        BinaryValue bvDeser = new BinaryValue( ( AttributeType ) null );
        bvDeser.readExternal( in );

        assertEquals( bv3, bvDeser );
    }
View Full Code Here

        ObjectInputStream in = null;

        byte[] data = baos.toByteArray();
        in = new ObjectInputStream( new ByteArrayInputStream( data ) );

        BinaryValue bvDeser = new BinaryValue( ( AttributeType ) null );
        bvDeser.readExternal( in );

        assertEquals( bv1n, bvDeser );
    }
View Full Code Here

        ObjectInputStream in = null;

        byte[] data = baos.toByteArray();
        in = new ObjectInputStream( new ByteArrayInputStream( data ) );

        BinaryValue bvDeser = new BinaryValue( ( AttributeType ) null );
        bvDeser.readExternal( in );

        assertEquals( bv2n, bvDeser );
    }
View Full Code Here

        ObjectInputStream in = null;

        byte[] data = baos.toByteArray();
        in = new ObjectInputStream( new ByteArrayInputStream( data ) );

        BinaryValue bvDeser = new BinaryValue( ( AttributeType ) null );
        bvDeser.readExternal( in );

        assertEquals( bv3n, bvDeser );
    }
View Full Code Here

                    for ( byte b : val )
                    {
                        newVal[i++] = ( byte ) ( b & 0x007F );
                    }

                    return new BinaryValue( Strings.trim( newVal ) );
                }

                throw new IllegalStateException( "expected byte[] to normalize" );
            }
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.entry.BinaryValue

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.