All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.avaje.json.stream.DJsonOutput Maven / Gradle / Ivy

There is a newer version: 3.0-RC5
Show newest version
package io.avaje.json.stream;

import java.io.IOException;
import java.io.OutputStream;

/**
 * Default implementation that simply wraps OutputStream.
 */
final class DJsonOutput implements JsonOutput {

  private final OutputStream outputStream;

  DJsonOutput(OutputStream outputStream) {
    this.outputStream = outputStream;
  }

  @Override
  public void write(byte[] content, int offset, int length) throws IOException {
    outputStream.write(content, offset, length);
  }

  @Override
  public void flush() throws IOException {
    outputStream.flush();
  }

  @Override
  public void close() throws IOException {
    outputStream.close();
  }

  @Override
  public OutputStream unwrapOutputStream() {
    return outputStream;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy