Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.GregorianCalendar;

public class Main {
    public static GregorianCalendar calendarFromBytes(byte[] buffer, int offset) {
        if (offset + 5 > buffer.length)
            return null;
        GregorianCalendar cal = new GregorianCalendar();
        cal.set(buffer[offset] + 2000, buffer[offset + 1], buffer[offset + 2], buffer[offset + 3],
                buffer[offset + 4], buffer[offset + 5]);
        return cal;
    }
}