public void write(final byte[] b, final int off, final int len) throws IOException { System.err.write(b, off, len); }
public void write(final int b) throws IOException { System.err.write(b); } }
public void write(final int b) throws IOException { System.out.write(b); } }
public void write(final byte[] b, final int off, final int len) throws IOException { System.out.write(b, off, len); }
public void write(final byte[] b) throws IOException { System.err.write(b); }
public void write(final byte[] b) throws IOException { System.out.write(b); }
@Override public void write(byte[] b) throws IOException { for (PrintStream stream : delegates) { stream.write(b); } } }
@Override public void write(int b) { for (PrintStream stream : delegates) { stream.write(b); } }
@Override public void write(byte[] buf, int off, int len) { for (PrintStream stream : delegates) { stream.write(buf, off, len); } }
@Override public void output(final String output) throws IOException { System.out.write(output.getBytes()); System.out.flush(); }
@Override public void output(final String output) throws IOException { System.out.write(output.getBytes()); System.out.flush(); }
private void writeDownloadMessage() { try (InputStream in = getClass().getClassLoader().getResourceAsStream("axonserver_download.txt")) { byte[] buffer = new byte[1024]; int read; while ((read = in.read(buffer, 0, 1024)) >= 0) { System.out.write(buffer, 0, read); } } catch (IOException e) { logger.debug("Unable to write download advice. You're on your own now.", e); } }
@Override public void copyFromLocalFile(File srcFile, URI dstUri) throws Exception { OutputStream stream = _adlStoreClient.createFile(dstUri.getPath(), IfExists.OVERWRITE); PrintStream out = new PrintStream(stream); byte[] inputStream = IOUtils.toByteArray(new FileInputStream(srcFile)); out.write(inputStream); out.close(); }
@Override public void write( byte b[], int off, int len ) { final PrintStream currentStream = getOutputStreamForCurrentThread(); synchronized ( currentStream ) { currentStream.write( b, off, len ); currentStream.notifyAll(); } }
@Override public void write( byte b[] ) throws IOException { final PrintStream currentStream = getOutputStreamForCurrentThread(); synchronized ( currentStream ) { currentStream.write( b ); currentStream.notifyAll(); } } }
public static void checkWrite(final OutputStream output) throws Exception { try { new java.io.PrintStream(output).write(0); } catch (final Throwable t) { throw new AssertionFailedError( "The copy() method closed the stream " + "when it shouldn't have. " + t.getMessage()); } }
private synchronized void writeStderr(String text) throws IOException { boolean sendStderr = OutputManager.sendStderr(text); if (!sendStderr) { BeakerOutputHandlers hrs = handlers.get(Thread.currentThread().getThreadGroup()); if (hrs != null && hrs.err_handler != null) { hrs.err_handler.write(text); } else { orig_err.write(text.getBytes(StandardCharsets.UTF_8)); } } }
private synchronized void writeStdout(String text) throws IOException { boolean sendStdout = OutputManager.sendStdout(text); if (!sendStdout) { BeakerOutputHandlers hrs = handlers.get(Thread.currentThread().getThreadGroup()); if (hrs != null && hrs.out_handler != null) { hrs.out_handler.write(text); } else { orig_out.write(text.getBytes(StandardCharsets.UTF_8)); } } }
@Override public void publish(LogRecord record) { if (getFormatter() == null) { setFormatter(new SimpleFormatter()); } try { String message = getFormatter().format(record); if (record.getLevel().intValue() >= Level.WARNING.intValue()) { System.err.write(message.getBytes()); } else { if (record.getLevel().intValue() >= Level.INFO.intValue()) { System.out.write(message.getBytes()); } else { if (verbosity == Verbosity.VERBOSE) { System.out.write(message.getBytes()); } } } } catch (Exception exception) { reportError(null, exception, ErrorManager.FORMAT_FAILURE); } } @Override
@Override void restore( boolean failure ) throws IOException { replace( old ).flush(); if ( failure ) { old.write( buffer.toByteArray() ); } } };