MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.nio.ByteBuffer;

public class MainClass {
    public static void main(String[] args) {
        ByteBuffer bb = ByteBuffer.wrap(new byte[] { 0, 0, 0, 0, 0, 0, 0, 'a' });
        bb.rewind();
        System.out.println("Byte Buffer");
        while (bb.hasRemaining())
            System.out.println(bb.position() + " -> " + bb.get());
    }
}
/**/