forked from eclipse-lemminx/lemminx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Fred Bricon <[email protected]>
- Loading branch information
1 parent
7ea504d
commit 044bef0
Showing
7 changed files
with
190 additions
and
41 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/NoOpInputStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lemminx; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
/** | ||
* No-Op {@link InputStream} | ||
* | ||
* @author Fred Bricon | ||
*/ | ||
class NoOpInputStream extends InputStream { | ||
|
||
@Override | ||
public int read() throws IOException { | ||
return -1; | ||
} | ||
|
||
@Override | ||
public int read(byte[] b) throws IOException { | ||
return -1; | ||
} | ||
|
||
@Override | ||
public int read(byte[] b, int off, int len) throws IOException { | ||
return -1; | ||
} | ||
|
||
@Override | ||
public int available() throws IOException { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public synchronized void mark(int readlimit) { | ||
} | ||
|
||
@Override | ||
public boolean markSupported() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public synchronized void reset() throws IOException { | ||
} | ||
|
||
@Override | ||
public long skip(long n) throws IOException { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/NoOpOutputStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lemminx; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
|
||
/** | ||
* No-Op {@link OutputStream}. | ||
* | ||
* @author Fred Bricon | ||
*/ | ||
class NoOpOutputStream extends OutputStream { | ||
|
||
@Override | ||
public void write(int b) throws IOException { | ||
} | ||
|
||
@Override | ||
public void write(byte[] b, int off, int len) { | ||
} | ||
|
||
@Override | ||
public void write(byte[] b) throws IOException { | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/NoOpPrintStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lemminx; | ||
|
||
import java.io.PrintStream; | ||
|
||
/** | ||
* No-Op {@link PrintStream}. | ||
* | ||
* @author Fred Bricon | ||
*/ | ||
class NoOpPrintStream extends PrintStream { | ||
|
||
public NoOpPrintStream() { | ||
super(new NoOpOutputStream()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters