code: public void writeIntCurrentPosition(int v) throws IOException {
      int index = (int)(position - bufferOffset);
      if (index < maxBufferSize) {
        buffer[index] = v;
        isByte[index] = false;
        if (index + 1 > currentBufferSize) currentBufferSize = index + 1;
        if (index + 1 >= maxBufferSize) {
          writeBuffer();
          newBuffer(position + 1);
        }
      } else {
        aFile.write(v);
      }
      position++;
    }
docs: Write byte.
  
  @param v the v
  @throws IOException Signals that an I/O exception has occurred.