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
public class WhiteByteChannel implements ReadableByteChannel { | |
@Override | |
public int read(final ByteBuffer dst) throws IOException { | |
final int remaining = dst.remaining(); | |
dst.position(dst.limit()); | |
return remaining; | |
} | |
@Override |
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
public class BlackByteChannel implements WritableByteChannel { | |
@Override | |
public int write(final ByteBuffer src) throws IOException { | |
final int remainging = src.remaining(); | |
src.position(src.limit()); | |
return remainging; | |
} | |
@Override |
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
public class FunnelOutputStream extends FilterOutputStream { | |
public FunnelOutputStream(final OutputStream out) { | |
super(out); | |
} | |
} |
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
public class FunnelInputStream extends FilterInputStream { | |
public FunnelInputStream(final InputStream in) { | |
super(in); | |
} | |
@Override | |
public int read(final byte[] b, final int off, final int len) throws IOExeption { | |
if (b == null) { | |
throw new NullPointerException("null b"); |
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
/** | |
* A class whose {@code main(String[])} method | |
* prints {@code hello, world\n} to {@code System.out}. | |
* | |
* @author Jin Kwon <jinahya_at_gmail.com> | |
*/ | |
public class HelloWorld { | |
/** | |
* Prints "hello, world\n" to {@code System.out}. |
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
import static com.github.jinahya.logback.core.LogRecorderReflector; | |
import org.slf4j.Logger; | |
public class LogRecoderExample { | |
public static void main(final String[] args) | |
throws ReflectiveOperationException { | |
final String records; | |
final LogRecorder recorder = LogRecorderReflector.start( | |
getLogger(Logger.ROOT_LOGGER_NAME), // the logger whose log events are recorded | |
"%message%n", // the pattern for formatting log events |
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
#!/bin/sh | |
#do dos2unix if required | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
sudo apt-get -y dist-upgrade | |
sudo apt-get -y autoremove | |
sudo apt-get -y autoclean | |
sudo apt-get -y clean |
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
# finds and export JAVA_HOME | |
#export JAVA_HOME=$(dirname $(dirname $(readlink -e /usr/bin/javac))) | |
export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") |
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
simple string |
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
. |
OlderNewer