Category: Serializing objects to byte arrays

Introducing the Skip List data structure – Arrays, collections and data structuresIntroducing the Skip List data structure – Arrays, collections and data structures

113. Introducing the Skip List data structure The Skip List data structure is a probabilistic data structure built on top of a linked list. A Skip List uses an underlying [...]

Introducing the Binomial Heap data structure 3 – Arrays, collections and data structuresIntroducing the Binomial Heap data structure 3 – Arrays, collections and data structures

Implementing unionHeap(BinomialHeap heap) Consider two Binomial Heaps (H1 and H2). The goal of the union operation is to create H3 by unifying H1 with H2. Let’s assume that H1 (having [...]

Introducing the Huffman Coding data structure – Arrays, collections and data structuresIntroducing the Huffman Coding data structure – Arrays, collections and data structures

119. Introducing the Huffman Coding data structure The Huffman Coding algorithm was developed by David A. Huffman in 1950 and it can be easily understood via an example. Let’s assume [...]

Serializing objects to XML – Java I/O: Context-Specific Deserialization FiltersSerializing objects to XML – Java I/O: Context-Specific Deserialization Filters

126. Serializing objects to XML Serializing/deserializing objects to XML via the JDK API can be accomplished via java.beans.XMLEncoder, respectively XMLDecoder. The XMLEncoder API relies on Java Reflection to discover the [...]

Introducing JDK 9 deserialization filter – Java I/O: Context-Specific Deserialization FiltersIntroducing JDK 9 deserialization filter – Java I/O: Context-Specific Deserialization Filters

127. Introducing JDK 9 deserialization filter As you know from Chapter 4, Problem X, deserialization is exposed to vulnerabilities that may cause serious security issues. In other words, between a [...]

Avoiding StackOverflowError at deserialization – Java I/O: Context-Specific Deserialization FiltersAvoiding StackOverflowError at deserialization – Java I/O: Context-Specific Deserialization Filters

132. Avoiding StackOverflowError at deserialization Let’s consider the following snippet of code: // ‘mapOfSets’ is the object to serialize/deserializeHashMap<Set, Integer> mapOfSets = new HashMap<>();Set<Set> set = new HashSet<>();mapOfSets.put(set, 1);set.add(set); And, [...]

Tackling context-specific deserialization filters – Java I/O: Context-Specific Deserialization FiltersTackling context-specific deserialization filters – Java I/O: Context-Specific Deserialization Filters

135. Tackling context-specific deserialization filters JDK 17 enriched the deserialization filter capabilities with the implementation of JEP 415, Context-Specific Deserialization Filters.Practically, JDK 17 added the so-called Filter Factories. Depending on [...]

Monitoring Deserialization via JFR – Java I/O: Context-Specific Deserialization FiltersMonitoring Deserialization via JFR – Java I/O: Context-Specific Deserialization Filters

136. Monitoring Deserialization via JFR JFR stands for Java Flight Recorder and it is an event-based tool for diagnosis and profiling Java applications. This tool was initially added in JDK [...]