Package org.lilyproject.bytes.api

Examples of org.lilyproject.bytes.api.DataOutput.writeByte()


        DataOutput dataOutput = new DataOutputImpl();
        boolean b = random.nextBoolean();
        dataOutput.writeBoolean(b);
        byte[] bytes = new byte[10];
        random.nextBytes(bytes);
        dataOutput.writeByte(bytes[0]);
        dataOutput.writeBytes(bytes);
        double d = random.nextDouble();
        dataOutput.writeDouble(d);
        float f = random.nextFloat();
        dataOutput.writeFloat(f);
View Full Code Here


            }

            DataOutput dataOutput = new DataOutputImpl();
            boolean hasMetadata = metadata != null && !metadata.getMap().isEmpty();

            dataOutput.writeByte(hasMetadata ? FieldFlags.METADATA_V1 : FieldFlags.DEFAULT);
            try {
                valueType.write(fieldValue, dataOutput, new IdentityRecordStack(parentRecord));
            } catch (InterruptedException e) {
                throw e;
            } catch (Exception e) {
View Full Code Here

        return encodeValueType(valueType.getName());
    }

    public static byte[] encodeValueType(String valueTypeName) {
        DataOutput dataOutput = new DataOutputImpl();
        dataOutput.writeByte(valueTypeEncodingVersion);
        dataOutput.writeUTF(valueTypeName);
        return dataOutput.toByteArray();
    }

    private ValueType decodeValueType(byte[] bytes) throws RepositoryException, InterruptedException {
View Full Code Here

            Metadata metadata = record.getMetadata(fieldName);
            boolean hasMetadata = metadata != null && !metadata.getMap().isEmpty();

            DataOutput output = new DataOutputImpl();

            output.writeByte(hasMetadata ? FieldFlags.METADATA_V1 : FieldFlags.DEFAULT);
            output.writeBytes(fieldType.getValueType().toBytes(record.getField(fieldName), new IdentityRecordStack()));
            if (hasMetadata) {
                HBaseRepository.writeMetadataWithLengthSuffix(metadata, output);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.