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

com.googlecode.kevinarpe.papaya.appendable.ByteAppendable Maven / Gradle / Ivy

package com.googlecode.kevinarpe.papaya.appendable;

/*
 * #%L
 * This file is part of Papaya.
 * %%
 * Copyright (C) 2013 - 2014 Kevin Connor ARPE ([email protected])
 * %%
 * Papaya is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * GPL Classpath Exception:
 * This project is subject to the "Classpath" exception as provided in
 * the LICENSE file that accompanied this code.
 * 
 * Papaya is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Papaya.  If not, see .
 * #L%
 */

import java.io.IOException;

import com.googlecode.kevinarpe.papaya.container.ByteArraySimpleBuilder;
import com.googlecode.kevinarpe.papaya.process.ProcessBuilder2;
import com.googlecode.kevinarpe.papaya.process.ProcessOutputStreamSettings;

/**
 * This is a byte-based-version of {@link Appendable}, which is character-based.  If STDOUT or
 * STDERR are expect to produce non-character data, use
 * {@link ProcessOutputStreamSettings#byteCallback(ByteAppendable)}
 * via:
 * 
    *
  • {@link ProcessBuilder2#stdoutSettings()}
  • *
  • {@link ProcessBuilder2#stderrSettings()}
  • *
* * @author Kevin Connor ARPE ([email protected]) */ public interface ByteAppendable { /** * If you need to accumulate the incoming bytes, consider using {@link ByteArraySimpleBuilder}. * * @param byteArr the byte array to append * @throws IOException if {@code byteArr} cannot be consumed -- I/O error */ void append(byte[] byteArr) throws IOException; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy