-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- optional packages, not provided - they serve as an alternative - cleanup - without previous commit it was impossible to find the bug - in fact there were two: - enhanceForTarget originally returned it's parameter, not null - inaccessible imports Signed-off-by: David Matějček <dmatej@seznam.cz>
- Loading branch information
Showing
12 changed files
with
678 additions
and
386 deletions.
There are no files selected for viewing
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
51 changes: 51 additions & 0 deletions
51
nucleus/common/common-util/src/main/java/org/glassfish/common/util/io/EmptyInputStream.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,51 @@ | ||
/* | ||
* Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.common.util.io; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
/** | ||
* Input stream which doesn't contain anything. | ||
* | ||
* @author David Matejcek | ||
*/ | ||
public class EmptyInputStream extends InputStream { | ||
|
||
@Override | ||
public int read() throws IOException { | ||
return -1; | ||
} | ||
|
||
|
||
@Override | ||
public int available() throws IOException { | ||
return 0; | ||
} | ||
|
||
|
||
@Override | ||
public int read(final byte[] b) throws IOException { | ||
return -1; | ||
} | ||
|
||
|
||
@Override | ||
public int read(final byte[] b, final int off, final int len) throws IOException { | ||
return -1; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
nucleus/common/common-util/src/main/java/org/glassfish/common/util/io/EmptyOutputStream.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,46 @@ | ||
/* | ||
* Copyright (c) 2022 Eclipse Foundation and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.common.util.io; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
|
||
|
||
/** | ||
* Ignores all input, so is always empty. | ||
* | ||
* @author David Matejcek | ||
*/ | ||
public class EmptyOutputStream extends OutputStream { | ||
|
||
@Override | ||
public void write(int b) throws IOException { | ||
return; | ||
} | ||
|
||
|
||
@Override | ||
public void write(byte[] b) throws IOException { | ||
return; | ||
} | ||
|
||
|
||
@Override | ||
public void write(byte[] b, int off, int len) throws IOException { | ||
return; | ||
} | ||
} |
Oops, something went wrong.