@Override public void write(byte[] b) throws IOException { write(b, 0, b.length); } /*
public void write(byte[] b) throws IOException { write(b, 0, b.length); } /*
@Override public void write(int b) throws IOException { write(new byte[] {(byte)b}, 0, 1); }
public void write(int b) throws IOException { write(new byte[] {(byte)b}, 0, 1); }
@Override protected void init() { super.init(); // create a stream to write info message to try (IOConsoleOutputStream info = newOutputStream()) { info.write(PDEUIMessages.OSGiConsoleFactory_title); info.write('\n'); } catch (IOException e) { PDEPlugin.log(e); } BundleContext context = PDEPlugin.getDefault().getBundle().getBundleContext(); context.registerService(ConsoleSession.class.getName(), session, null); }
public void printDefaultMessage() { if (getConsole().getDocument().get().isEmpty()) { //getConsoleStream().println("LogViewer started!"); try { getConsoleStream().write("Paste messages into this console and check rules and filters in LogViewer.\n"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
public void run() { if(isVisible()) { try { switch(type) { case ConsoleDocument.COMMAND: getCommandStream().write(line); getCommandStream().write('\n'); break; case ConsoleDocument.MESSAGE: getMessageStream().write(line); getMessageStream().write('\n'); break; case ConsoleDocument.ERROR: getErrorStream().write(line); getErrorStream().write('\n'); break; } } catch(IOException ex) { // Don't log using slf4j - it will cause a cycle ex.printStackTrace(); } } else { getConsoleDocument().appendConsoleLine(type, line); } } });
public void run() { isRunning = true; try { int readwait = LogViewerPlugin.getDefault().getPreferenceStore().getInt(ILogViewerConstants.PREF_READWAIT); inStream = getInputStream(); while(isRunning) { int available = inStream.available(); if (available > 0) { byte[] readed = new byte[available]; inStream.read(readed, 0, available); outStream.write(readed); //continue; } wait(readwait); } } catch(InterruptedException ie) { } catch(NullPointerException npe) { } catch (IOException e) { } finally { } isRunning = false; }