List of usage examples for java.nio BufferOverflowException BufferOverflowException
public BufferOverflowException()
BufferOverflowException
. From source file:ome.io.nio.RomioPixelBuffer.java
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#setPlane(ByteBuffer, Integer, Integer, Integer) */// w ww . j a v a 2 s . co m public void setPlane(ByteBuffer buffer, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException { throwIfReadOnly(); Long offset = getPlaneOffset(z, c, t); Integer size = getPlaneSize(); if (buffer.limit() != size) { // Handle the size mismatch. if (buffer.limit() < size) throw new BufferUnderflowException(); throw new BufferOverflowException(); } setRegion(size, offset, buffer); }
From source file:ome.io.nio.RomioPixelBuffer.java
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#setStack(ByteBuffer, Integer, Integer, Integer) */// w ww .j a va2 s. c om public void setStack(ByteBuffer buffer, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException { throwIfReadOnly(); Long offset = getStackOffset(c, t); Integer size = getStackSize(); if (buffer.limit() != size) { // Handle the size mismatch. if (buffer.limit() < size) throw new BufferUnderflowException(); throw new BufferOverflowException(); } setRegion(size, offset, buffer); }
From source file:ome.io.nio.RomioPixelBuffer.java
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#setTimepoint(ByteBuffer, Integer) */// w w w. j a v a 2 s .com public void setTimepoint(ByteBuffer buffer, Integer t) throws IOException, DimensionsOutOfBoundsException { throwIfReadOnly(); Long offset = getTimepointOffset(t); Integer size = getTimepointSize(); if (buffer.limit() != size) { // Handle the size mismatch. if (buffer.limit() < size) throw new BufferUnderflowException(); throw new BufferOverflowException(); } setRegion(size, offset, buffer); }