equal
deleted
inserted
replaced
416 |
416 |
417 /** |
417 /** |
418 * Implements a <a href="#redirect-output">null input stream</a>. |
418 * Implements a <a href="#redirect-output">null input stream</a>. |
419 */ |
419 */ |
420 static class NullInputStream extends InputStream { |
420 static class NullInputStream extends InputStream { |
|
421 static final NullInputStream INSTANCE = new NullInputStream(); |
|
422 private NullInputStream() {} |
421 public int read() { return -1; } |
423 public int read() { return -1; } |
422 public int available() { return 0; } |
424 public int available() { return 0; } |
423 } |
425 } |
424 |
426 |
425 /** |
427 /** |
426 * Implements a <a href="#redirect-input">null output stream</a>. |
428 * Implements a <a href="#redirect-input">null output stream</a>. |
427 */ |
429 */ |
428 static class NullOutputStream extends OutputStream { |
430 static class NullOutputStream extends OutputStream { |
|
431 static final NullOutputStream INSTANCE = new NullOutputStream(); |
|
432 private NullOutputStream() {} |
429 public void write(int b) throws IOException { |
433 public void write(int b) throws IOException { |
430 throw new IOException("Stream closed"); |
434 throw new IOException("Stream closed"); |
431 } |
435 } |
432 } |
436 } |
433 |
437 |