Examples of Bytes


Examples of org.apache.wicket.util.lang.Bytes

  {
    Locale.setDefault(Locale.UK);
    Assert.assertTrue("1G".equals(Bytes.gigabytes(1).toString()));
    Assert.assertTrue(Bytes.valueOf("15.5K").bytes() == ((15 * 1024) + 512));

    final Bytes b = Bytes.kilobytes(7.3);

    Assert.assertTrue(Bytes.valueOf(b.toString()).equals(b));
  }
View Full Code Here

Examples of org.apache.wicket.util.lang.Bytes

  {
    Locale.setDefault(Locale.GERMANY);
    Assert.assertTrue("1G".equals(Bytes.gigabytes(1).toString()));
    Assert.assertTrue(Bytes.valueOf("15,5K").bytes() == ((15 * 1024) + 512));

    final Bytes b = Bytes.kilobytes(7.3);

    Assert.assertTrue(Bytes.valueOf(b.toString()).equals(b));
  }
View Full Code Here

Examples of org.apache.wicket.util.lang.Bytes

  {
    Assert.assertTrue("1G".equals(Bytes.gigabytes(1).toString()));
    Assert.assertTrue("1,5G".equals(Bytes.gigabytes(1.5).toString(Locale.GERMAN)));
    Assert.assertTrue("1.5G".equals(Bytes.gigabytes(1.5).toString(Locale.US)));

    final Bytes b = Bytes.kilobytes(7.3);
    Assert.assertEquals(b, Bytes.valueOf(b.toString(Locale.GERMAN), Locale.GERMAN));

    Assert.assertTrue(Bytes.valueOf("15,5K", Locale.GERMAN).bytes() == ((15 * 1024) + 512));
    Assert.assertTrue(Bytes.valueOf("15.5K", Locale.US).bytes() == ((15 * 1024) + 512));
  }
View Full Code Here

Examples of org.apache.wicket.util.lang.Bytes

  {
    Assert.assertTrue(Bytes.bytes(1024).equals(Bytes.kilobytes(1)));
    Assert.assertTrue(Bytes.bytes(1024 * 1024).equals(Bytes.megabytes(1)));
    Assert.assertTrue("1G".equals(Bytes.gigabytes(1).toString()));

    final Bytes b = Bytes.kilobytes(7.3);

    Assert.assertTrue(b.equals(Bytes.kilobytes(7.3)));
    Assert.assertTrue(b.greaterThan(Bytes.kilobytes(7.25)));
    Assert.assertTrue(b.lessThan(Bytes.kilobytes(7.9)));
    Assert.assertTrue(Bytes.valueOf(b.toString()).equals(b));
  }
View Full Code Here

Examples of org.assertj.core.internal.Bytes

  }

  @Override
  public S usingComparator(Comparator<? super Byte> customComparator) {
    super.usingComparator(customComparator);
    this.bytes = new Bytes(new ComparatorBasedComparisonStrategy(customComparator));
    return myself;
  }
View Full Code Here

Examples of org.scale7.cassandra.pelops.Bytes

            // iterate through complete map and
            Iterator<Bytes> rowIter = qResults.keySet().iterator();
            while (rowIter.hasNext())
            {
                Bytes rowKey = rowIter.next();

                PropertyAccessor<?> accessor = PropertyAccessorFactory.getPropertyAccessor((Field) metadata
                        .getIdAttribute().getJavaMember());
                Object value = accessor.fromBytes(metadata.getIdAttribute().getJavaType(), rowKey.toByteArray());

                rowKeys.add(value);
            }
        }
        if (rowKeys != null && !rowKeys.isEmpty())
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.