Package org.lilyproject.bytes.api

Examples of org.lilyproject.bytes.api.DataInput


        dataOutput.writeUTF(valueTypeName);
        return dataOutput.toByteArray();
    }

    private ValueType decodeValueType(byte[] bytes) throws RepositoryException, InterruptedException {
        DataInput dataInput = new DataInputImpl(bytes);
        if (valueTypeEncodingVersion != dataInput.readByte()) {
            throw new TypeException("Unknown value type encoding version encountered in schema");
        }

        return getValueType(dataInput.readUTF());
    }
View Full Code Here


    }

    public static Set<String> deserialize(byte[] stringsAsBytes) {
        Set<String> permissions = new HashSet<String>();

        DataInput input = new DataInputImpl(stringsAsBytes);
        int permCount = input.readVInt();
        for (int i = 0; i < permCount; i++) {
            permissions.add(input.readVUTF());
        }

        return permissions;
    }
View Full Code Here

        return buffer.toByteArray();
    }

    public static AuthorizationContext deserialiaze(byte[] data) {
        DataInput input = new DataInputImpl(data);

        String name = input.readVUTF();
        String tenant = input.readVUTF();

        Set<String> roles = new HashSet<String>();
        int roleCnt = input.readVInt();
        for (int i = 0; i < roleCnt; i++) {
            roles.add(input.readVUTF());
        }

        return new AuthorizationContext(name, tenant, roles);
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.bytes.api.DataInput

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.