Package net.bnubot.util

Examples of net.bnubot.util.ByteArray


  public void testEncode() {
    assertEquals(Base64.encode(new ByteArray("asdf")), "YXNkZg==");
  }

  public void testDecode() {
    assertEquals(Base64.decode(new ByteArray("YXNkZg==")), "asdf");
  }
View Full Code Here


/**
* @author scotta
*/
public class DMCryptoTest extends TestCase {
  public void testComplete() {
    ByteArray in = new ByteArray("testing 1 2 3");
    ByteArray out = DMCrypto.decode(DMCrypto.encode(in));

    assertEquals(in, out);
  }
View Full Code Here

    assertEquals(ProductIDs.W3XP.getDword(), HexDump.PrettyToDWord("W3XP"));
  }

  public void testHexDump() throws Exception {
    String str = "00017f80ff";
    assertEquals(HexDump.encode(new ByteArray(new byte[] {0x00, 0x01, 0x7F, (byte)0x80, (byte)0xFF})), str);
    assertEquals(HexDump.encode(HexDump.decode(new ByteArray(str))), str);
  }
View Full Code Here

*/
public class ByteFromIntArrayTest extends TestCase {
  public void test() {
    int []test = { 0x01234567, 0x89abcdef };
    ByteFromIntArray bfia = new ByteFromIntArray(false);
    assertEquals(new ByteArray(
        new byte[] { 0x01, 0x23, 0x45, 0x67, (byte)0x89, (byte)0xab, (byte)0xcd, (byte)0xef }),
        bfia.getByteArray(test));
  }
View Full Code Here

TOP

Related Classes of net.bnubot.util.ByteArray

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.