code: @Override
      public void write(int b) throws IOException {
          if (this.isClosed) {
              throw new IOException("OutputStream is closed.");
          }
  
          if (this.position >= this.length) {
              throw new IOException("Buffer capacity exceeded.");
          }
  
          this.array[this.offset + this.position] = (byte) b;
          this.position++;
      }
docs: region OutputStream and RandomAccessOutputStream Implementation