Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

markenwerk/java-commons-nulls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Some common null objects for Java

Build Status Coverage Status Dependency Status Maven Central Java SE 6 MIT License

Overview

This is a collection of null objects (i.e. implementations that do nothing) for the following use cases:

This library is hosted in the Maven Central Repository. You can use it with the following coordinates:

<dependency>
	<groupId>net.markenwerk</groupId>
	<artifactId>commons-nulls</artifactId>
	<version>1.0.4</version>
</dependency>

Consult the usage description and Javadoc for further information.

Usage

InputStream and OutputStream

This library provides NullInputStream as a null implementation of an InputStream and NullOutputStream as a null implementation of an OutputStream.

// an InputStream that yields no bytes
InputStream in = new NullInputStream();

// an OutputStream that drops all bytes
OutputStream in = new NullOutputStream();

Reader and Writer

This library provides NullReader as a null implementation of a Reader and NullWriter as a null implementation of a Writer.

// an InputStream that yields no characters
Reader in = new NullReader();

// an OutputStream that drops all characters
Writer in = new NullWriter();

About

Some common null objects for Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages