Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {

    public static byte[] StringToHexBytes(int length, String string) {
        byte[] data = new byte[length];
        byte[] strByte = string.getBytes();
        for (int i = 0; i < strByte.length; i++) {
            data[i] = strByte[i];
        }
        return data;
    }
}