Examples of fromBytes()


Examples of org.lilyproject.repository.impl.id.IdGeneratorImpl.fromBytes()

                /* length of key (vint) */, 1
                /* the key (letter X) */, 88
                /* length of value (vint) */, 3
                /* the value (ABC) */, 65, 66, 67 };

        RecordId variantId = idGenerator.newRecordId(idGenerator.fromBytes(masterIdBytes),
                Collections.singletonMap("X", "ABC"));
        assertArrayEquals(variantIdBytes, variantId.toBytes());
    }

    @Test
View Full Code Here

Examples of org.lilyproject.repository.impl.id.IdGeneratorImpl.fromBytes()

        assertEquals(variantRecordIdString, variantRecordId.toString());
        assertEquals(variantRecordId, idGenerator.fromString(variantRecordIdString));

        // Test round-trip string & bytes conversion
        assertEquals(variantRecordId, idGenerator.fromString(variantRecordIdString));
        assertEquals(variantRecordId, idGenerator.fromBytes(variantRecordId.toBytes()));
    }

    @Test
    public void testUserIdWithVariantProperties() {
        IdGenerator idGenerator = new IdGeneratorImpl();
View Full Code Here

Examples of org.lilyproject.repository.impl.id.IdGeneratorImpl.fromBytes()

        // Test it is recognized as variant
        assertFalse(variantId.isMaster());

        // Test round-trip string & bytes conversion
        assertEquals(variantId, idGenerator.fromBytes(variantId.toBytes()));
        assertEquals(variantId, idGenerator.fromString(variantId.toString()));

        // Test string representation is what it is supposed to be
        String expectedString = "USER.marvellous.a=x,aa=xx";
        assertEquals(expectedString, variantId.toString());
View Full Code Here

Examples of org.nasutekds.server.admin.SizeUnit.fromBytes()

          unit = SizeUnit.getBestFitUnit(v);
        }
      }

      MessageBuilder builder = new MessageBuilder();
      builder.append(numberFormat.format(unit.fromBytes(v)));
      builder.append(' ');
      builder.append(unit.getShortName());

      return builder.toMessage();
    }
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.