Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;

import java.util.List;

public class Main {

    public static List<Integer> convertOXYLByteArr2List(byte[] bytes) {

        if (bytes != null && bytes.length > 0) {

            List<Integer> oxygenLongList = new ArrayList<>();
            String oxyl = new String(bytes);
            char[] oxylChar = oxyl.toCharArray();
            for (int i = 0; i < oxylChar.length; i++) {
                int oxygen = oxylChar[i];
                oxygenLongList.add(oxygen);
            }
            return oxygenLongList;
        }
        return null;
    }
}