code: @SuppressWarnings({"Duplicates"})
      public static ArrayByteOutput of(final int length, final OutputStream stream) {
          if (length <= 0) {
              throw new IllegalArgumentException("length(" + length + ") <= 0");
          }
          if (stream == null) {
              throw new NullPointerException("stream is null");
          }
          return new ArrayByteOutput(null) {
  
              @Override
              public void write(final int value) throws IOException {
                  if (target == null) {
                      target = new byte[length];
                      index = 0;
                  }
                  super.write(value);
                  if (index == target.length) {
                      stream.write(target);
                      index = 0;
                  }
              }
  
              @Override
              public void setTarget(final byte[] target) {
                  throw new UnsupportedOperationException();
              }
  
              @Override
              public void setIndex(final int index) {
                  throw new UnsupportedOperationException();
              }
          };
      }
docs: Creates a new instance of byte output which writes bytes to given output stream using an array of bytes whose
  {@code length} equals to specified.
  
  @param length the length of byte array; must be positive.
  @param stream the output stream to which bytes are written; must be not {@code null}.
  @return an instance byte output.