Java Code Examples for java.nio.Buffer#position()
The following examples show how to use
java.nio.Buffer#position() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Basic.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
static String toString(Buffer b) { return (b.getClass().getName() + "[pos=" + b.position() + " lim=" + b.limit() + " cap=" + b.capacity() + "]"); }
Example 2
Source File: SingleByte.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private static final CoderResult withResult(CoderResult cr, Buffer src, int sp, Buffer dst, int dp) { src.position(sp - src.arrayOffset()); dst.position(dp - dst.arrayOffset()); return cr; }
Example 3
Source File: Pointer.java From tapir with MIT License | 5 votes |
/** * Copies the address, position, limit, and capacity of a direct NIO {@link Buffer}. * Also keeps a reference to it to prevent its memory from getting deallocated. * * @param b the Buffer object to reference */ public Pointer(final Buffer b) { if (b != null) { allocate(b); } if (!isNull()) { position = b.position(); limit = b.limit(); capacity = b.capacity(); deallocator = new Deallocator() { Buffer bb = b; public void deallocate() { bb = null; } }; } }
Example 4
Source File: Basic.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
static String toString(Buffer b) { return (b.getClass().getName() + "[pos=" + b.position() + " lim=" + b.limit() + " cap=" + b.capacity() + "]"); }
Example 5
Source File: AbstractRenderer.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 5 votes |
public void drawTriangleList(VertexBuffer indexBuf, Mesh mesh, int count) { Mesh.Mode mode = mesh.getMode(); Buffer indexData = indexBuf.getData(); indexData.clear(); if (mesh.getMode() == Mode.Hybrid) { int[] modeStart = mesh.getModeStart(); int[] elementLengths = mesh.getElementLengths(); Mode elMode = Mode.Triangles; // int elSize = indexBuf.getFormat().getComponentSize(); // int listStart = modeStart[0]; int stripStart = modeStart[1]; int fanStart = modeStart[2]; int curOffset = 0; for (int i = 0; i < elementLengths.length; i++) { if (i == stripStart) { elMode = Mode.TriangleStrip; } else if (i == fanStart) { elMode = Mode.TriangleStrip; } int elementLength = elementLengths[i]; indexData.position(curOffset); drawElements(elMode, elementLength, indexBuf.getFormat(), indexData); curOffset += elementLength; } } else { drawElements(mode, indexData.capacity(), indexBuf.getFormat(), indexData); } }
Example 6
Source File: Basic.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
static String toString(Buffer b) { return (b.getClass().getName() + "[pos=" + b.position() + " lim=" + b.limit() + " cap=" + b.capacity() + "]"); }
Example 7
Source File: CESU_8.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private static CoderResult xflow(Buffer src, int mark, int nb) { src.position(mark); return (nb == 0 || src.remaining() < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW; }
Example 8
Source File: CESU_8.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private static final void updatePositions(Buffer src, int sp, Buffer dst, int dp) { src.position(sp - src.arrayOffset()); dst.position(dp - dst.arrayOffset()); }
Example 9
Source File: CESU_8.java From hottub with GNU General Public License v2.0 | 4 votes |
private static CoderResult xflow(Buffer src, int mark, int nb) { src.position(mark); return (nb == 0 || src.remaining() < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW; }
Example 10
Source File: CESU_8.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
private static CoderResult xflow(Buffer src, int mark, int nb) { src.position(mark); return (nb == 0 || src.remaining() < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW; }
Example 11
Source File: UTF_8.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
private static CoderResult xflow(Buffer src, int mark, int nb) { src.position(mark); return (nb == 0 || src.remaining() < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW; }
Example 12
Source File: CESU_8.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private static final void updatePositions(Buffer src, int sp, Buffer dst, int dp) { src.position(sp - src.arrayOffset()); dst.position(dp - dst.arrayOffset()); }
Example 13
Source File: UTF_8.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
private static CoderResult xflow(Buffer src, int mark, int nb) { src.position(mark); return (nb == 0 || src.remaining() < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW; }
Example 14
Source File: CESU_8.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private static CoderResult xflow(Buffer src, int mark, int nb) { src.position(mark); return (nb == 0 || src.remaining() < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW; }
Example 15
Source File: CESU_8.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private static final void updatePositions(Buffer src, int sp, Buffer dst, int dp) { src.position(sp - src.arrayOffset()); dst.position(dp - dst.arrayOffset()); }
Example 16
Source File: CESU_8.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private static CoderResult xflow(Buffer src, int mark, int nb) { src.position(mark); return (nb == 0 || src.remaining() < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW; }
Example 17
Source File: CESU_8.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private static final void updatePositions(Buffer src, int sp, Buffer dst, int dp) { src.position(sp - src.arrayOffset()); dst.position(dp - dst.arrayOffset()); }
Example 18
Source File: CESU_8.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
private static final void updatePositions(Buffer src, int sp, Buffer dst, int dp) { src.position(sp - src.arrayOffset()); dst.position(dp - dst.arrayOffset()); }
Example 19
Source File: CESU_8.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
private static final void updatePositions(Buffer src, int sp, Buffer dst, int dp) { src.position(sp - src.arrayOffset()); dst.position(dp - dst.arrayOffset()); }
Example 20
Source File: UTF_8.java From Bytecoder with Apache License 2.0 | 4 votes |
private static CoderResult xflow(Buffer src, int mark, int nb) { src.position(mark); return (nb == 0 || src.remaining() < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW; }