public static InputStream wrap(InputStream inputStream, InputStreamMonitor... monitors) { return new MonitorInputStreamWrapper(inputStream, monitors); }
@Override public int read(byte[] b) throws IOException { int length = originalInputStream.read(b); if (length > 0) { informMonitor(b, 0, length); } return length; }
public InputStream getInputStreamFromSocket() throws IOException { List<InputStreamMonitor> inputStreamMonitors = new ArrayList<>(monitors.size()); if (monitors != null) { for (SocketMonitor socketMonitor : monitors) { inputStreamMonitors.add(socketMonitor); } } return MonitorInputStreamWrapper.wrap(originalSocket.getInputStream(), inputStreamMonitors); }
@Override public int read(byte[] b, int off, int len) throws IOException { int length = originalInputStream.read(b, off, len); if (length > 0) { informMonitor(b, off, length); } return length; }
public InputStream getInputStreamFromSocket() throws IOException { List<InputStreamMonitor> inputStreamMonitors = new ArrayList<>(monitors.size()); if (monitors != null) { for (SocketMonitor socketMonitor : monitors) { inputStreamMonitors.add(socketMonitor); } } return MonitorInputStreamWrapper.wrap(originalSocket.getInputStream(), inputStreamMonitors); }
@Override public int read() throws IOException { int b = originalInputStream.read(); byte[] array = {(byte) b}; informMonitor(array); return b; }
public static InputStream wrap(InputStream inputStream, List<InputStreamMonitor> monitors) { return new MonitorInputStreamWrapper(inputStream, monitors); }
@Override public int read() throws IOException { int b = originalInputStream.read(); byte[] array = {(byte) b}; informMonitor(array); return b; }
public static InputStream wrap(InputStream inputStream, InputStreamMonitor... monitors) { return new MonitorInputStreamWrapper(inputStream, monitors); }
@Override public int read(byte[] b) throws IOException { int length = originalInputStream.read(b); if (length > 0) { informMonitor(b, 0, length); } return length; }
public static InputStream wrap(InputStream inputStream, List<InputStreamMonitor> monitors) { return new MonitorInputStreamWrapper(inputStream, monitors); }
@Override public int read(byte[] b, int off, int len) throws IOException { int length = originalInputStream.read(b, off, len); if (length > 0) { informMonitor(b, off, length); } return length; }