public synchronized void setTile(byte[] buffer, Integer z, Integer c, Integer t, Integer x, Integer y, Integer w, Integer h) throws IOException, BufferOverflowException { if (!isWrite()) { throw new ApiUsageException("In read-only mode!"); } try { int planeCount = getSizeZ() * getSizeC() * getSizeT(); int planeNumber = FormatTools.getIndex( "XYZCT", getSizeZ(), getSizeC(), getSizeT(), planeCount, z, c, t); IFD ifd = getIFD(z, c, t, w, h); if (log.isDebugEnabled()) { log.debug(String.format( "Writing tile planeNumber:%d bufferSize:%d ifd:%s " + "x:%d y:%d w:%d h:%d", planeNumber, buffer.length, ifd.toString(), x, y, w, h)); } writer.saveBytes(planeNumber, buffer, ifd, x, y, w, h); } catch (FormatException e) { throw new RuntimeException(e); } }