Java ByteBuffer Dump setDecreasedBuffer(ByteBuffer memoryDumpReader, long baseAddressValue, int innerPointerOffset, long memoryDumpStartingOffset)

Here you can find the source of setDecreasedBuffer(ByteBuffer memoryDumpReader, long baseAddressValue, int innerPointerOffset, long memoryDumpStartingOffset)

Description

set Decreased Buffer

License

Apache License

Declaration

public static void setDecreasedBuffer(ByteBuffer memoryDumpReader, long baseAddressValue,
            int innerPointerOffset, long memoryDumpStartingOffset) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.nio.ByteBuffer;

public class Main {
    public static void setDecreasedBuffer(ByteBuffer memoryDumpReader, long baseAddressValue,
            int innerPointerOffset, long memoryDumpStartingOffset) {
        int decreasedBufferPosition = (int) (baseAddressValue - memoryDumpStartingOffset + innerPointerOffset);

        if (decreasedBufferPosition < 0) {
            decreasedBufferPosition = 0;
        }//ww  w . j a  v a 2 s  . c  om

        memoryDumpReader.position(decreasedBufferPosition);
    }
}

Related

  1. dumpNextNBytes(ByteBuffer buffer, int n)
  2. dumpToFile(ByteBuffer buf, String fileName)
  3. hexDump(ByteBuffer buffer)
  4. hexDump(PrintStream ps, ByteBuffer bb)
  5. printByteDump(StringBuilder strBuilder, ByteBuffer data, int offset, int length, int columnNum)
  6. toHexDumpString(ByteBuffer data)