Java ByteBuffer Slice slice(ByteBuffer buf, int start, int end)

Here you can find the source of slice(ByteBuffer buf, int start, int end)

Description

slice

License

Open Source License

Declaration

public static ByteBuffer slice(ByteBuffer buf, int start, int end) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    public static ByteBuffer slice(ByteBuffer buf, int start, int end) {
        ByteBuffer b = buf.duplicate();
        b.position(start);//w  w w.  ja  v  a2 s.com
        b.limit(end);
        return b.slice();
    }
}

Related

  1. getSlice(ByteBuffer bb, int offset, int length)
  2. preservingSlice(final ByteBuffer byteBuffer, final int position, final int limit)
  3. slice(ByteBuffer buf, int pos, int limit)
  4. slice(ByteBuffer data)
  5. slice(final ByteBuffer buffer, final int offset, final int length)
  6. slice(final ByteBuffer buffer, final int position)
  7. sliceBuffer(ByteBuffer byteBuffer, int start, int end)