January 10 2017

Java BufferedWriter Example

Java BufferedWriter Example

BufferedWriter class writes text to a character-output stream, buffering characters and provides efficient writing of single characters, arrays, and strings. Compared to FileWriter, BufferedWriter writes relatively large amount of data to a file at once. The buffer size may be specified, or the default size may be used.

BufferedWriter provides a newLine() method to create platform-specific line separators automatically. Wrap the BufferedWriter around a FileWriter, to get access to high level methods.

Key methods: close(), flush(), newLine(), write()

Example Continue reading

January 2 2017

JAXB Unmarshaller Example

JAXB Unmarshaller Example

JAXB stands for Java Architecture for XML Binding. It provides mechanism to convert Java object to XML file (Marshalling) and XML file into a Java Object (Unmarshalling).

Unmarshalling

public interface Unmarshaller

The Unmarshaller class is responsible for converting XML data to Java Object.

Example Continue reading

Category: JAXB | LEAVE A COMMENT
January 2 2017

JAXB Marshaller Example

JAXB Marshaller Example

JAXB stands for Java Architecture for XML Binding. It provides mechanism to convert Java object to XML file (Marshalling) and XML file into a Java Object (Unmarshalling).

Marshalling

public interface Marshaller

The Marshaller class is responsible for converting Java object to XML data.

Example Continue reading

Category: JAXB | LEAVE A COMMENT