Package org.lilyproject.bytes.impl

Examples of org.lilyproject.bytes.impl.DataInputImpl


        assertNull(link.getMasterRecordId());
        assertEquals(".", link.toString());
        assertEquals(link, Link.fromString(link.toString(), idGenerator));
        DataOutput dataOutput = new DataOutputImpl();
        link.write(dataOutput);
        assertEquals(link, Link.read(new DataInputImpl(dataOutput.toByteArray()), idGenerator));


        Map<String, String> varProps = new HashMap<String, String>();
        varProps.put("lang", "en");
        varProps.put("branch", "dev");
View Full Code Here


        assertNull(link.getMasterRecordId());
        assertEquals(".!*", link.toString());
        assertEquals(link, Link.fromString(link.toString(), idGenerator));
        DataOutput dataOutput = new DataOutputImpl();
        link.write(dataOutput);
        assertEquals(link, Link.read(new DataInputImpl(dataOutput.toByteArray()), idGenerator));


        Map<String, String> varProps = new HashMap<String, String>();
        varProps.put("lang", "en");
        varProps.put("branch", "dev");
View Full Code Here

        return ByteBuffer.wrap(RecordAsBytesConverter.writeIdRecord(idRecord, repository));
    }

    public Record convertRecord(ByteBuffer recordData, LRepository repository)
            throws RepositoryException, InterruptedException {
        return RecordAsBytesConverter.read(new DataInputImpl(asArray(recordData)), repository);
    }
View Full Code Here

        return RecordAsBytesConverter.read(new DataInputImpl(asArray(recordData)), repository);
    }

    public IdRecord convertIdRecord(ByteBuffer avroIdRecord, LRepository repository)
            throws RepositoryException, InterruptedException {
        return RecordAsBytesConverter.readIdRecord(new DataInputImpl(asArray(avroIdRecord)), repository);
    }
View Full Code Here

        DataOutput dataOutput = new DataOutputImpl();

        // Do a write and lets not get exceptions
        recordVT.write(createdRecord, dataOutput, new IdentityRecordStack());

        DataInput dataInput = new DataInputImpl(dataOutput.toByteArray());

        // Do a read and lets not get exceptions
        Record readRecord = recordVT.read(dataInput);

        assertEquals(createdRecord.getFields(), readRecord.getFields());
View Full Code Here

public abstract class AbstractValueType implements ValueType {

    @Override
    public <T> T read(byte[] data) throws RepositoryException, InterruptedException {
        return read(new DataInputImpl(data));
    }
View Full Code Here

        DataOutput output = new DataOutputImpl();
        MetadataSerDeser.write(metadata, output);
        byte[] metadataBytes = output.toByteArray();

        Metadata readMetadata = MetadataSerDeser.read(new DataInputImpl(metadataBytes));
        assertEquals("value", readMetadata.get("string"));
        assertEquals(5, (int)readMetadata.getInt("int", null));
        assertEquals(99999999999L, (long)readMetadata.getLong("long", null));
        assertEquals(3.33f, readMetadata.getFloat("float", null), 0.001f);
        assertEquals(6.66d, (double)readMetadata.getDouble("double", null), 0.001d);
View Full Code Here

        return dataOutput.toByteArray();
    }

    Set<DependencyEntry> deserializeDependenciesForward(byte[] serialized) throws IOException {
        final DataInputImpl dataInput = new DataInputImpl(serialized);
        final int nDependencies = dataInput.readInt();

        final Set<DependencyEntry> result = new HashSet<DependencyEntry>(nDependencies);

        while (result.size() < nDependencies) {
            final int tableLength = dataInput.readInt();
            final String table = Bytes.toString(dataInput.readBytes(tableLength));
            final int masterBytesLength = dataInput.readInt();
            final byte[] masterBytes = dataInput.readBytes(masterBytesLength);

            final DerefMapVariantPropertiesPattern variantPropertiesPattern =
                    deserializeVariantPropertiesPattern(dataInput);

            result.add(new DependencyEntry(new AbsoluteRecordIdImpl(table,
View Full Code Here

        return dataOutput.toByteArray();
    }

    DerefMapVariantPropertiesPattern deserializeVariantPropertiesPattern(byte[] serialized) {
        return deserializeVariantPropertiesPattern(new DataInputImpl(serialized));
    }
View Full Code Here

                    Object decodedValue;
                    if (FieldFlags.isDeletedField(value[0])) {
                        decodedValue = Fields.DELETED;
                    } else {
                        decodedValue = fieldType.getValueType().read(new DataInputImpl(EncodingUtil.stripPrefix(value)));
                    }

                    columns.put(fieldId, decodedValue);
                }
            } else if (Arrays.equals(columnKey, RecordColumn.DELETED.bytes)) {
View Full Code Here

TOP

Related Classes of org.lilyproject.bytes.impl.DataInputImpl

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.