public static void main(String[] args) {
        try {
            FileInputStream fileInputStream = new FileInputStream("readsomebytes.txt");
            FileChannel channel = fileInputStream.getChannel();

            ByteBuffer allocate = ByteBuffer.allocate(2048);
            channel.read(allocate);
            allocate.flip();

            int i = 0;
            while (allocate.hasRemaining()){
                System.out.println( "Character "+i+": "+((byte) allocate.get()) );
                i++;
            }
            fileInputStream.close();

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }