• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Home
  • Blog
  • Sample Page

WordPress Tips

Just another WordPress site

Best Way to Append Data to File in Java – Apache commons.io.FileUtils and java.io.BufferedWriter Approach

June 27, 2017 Leave a Comment 2

What is the best way to append live data to a file in Java? It’s very easy for developer to print output or some debug data to Eclipse Console using println(). But what if you would like to save data for later use? Well, in Java you could use log4.xml file file to store log […]

How to Execute tcpdump Linux Command using Java Process Class and Capture TCP/IP Packets

June 16, 2017 Leave a Comment 43

Let’s take a look at a problem in which you may want to capture Tcpdump output in your Java Program. You may have There are N number of possibilities. How to capture Tcpdump data to analyse customer data? Tcpdump is very basic command and everybody I’m sure everybody may have used it by now Tcpdump is […]

Log File Tailer (tail -f) implementation in Java – Best way to tail any file programmatically

June 11, 2017 Leave a Comment 226

File operations using Java are my favorite part. There are number of tutorials you may have seen on Crunchify like append data to file, read data from file, read and parse JSON file, read config.properties file during server startup, etc. In this tutorial we will go over steps on how to implement linux tail -f […]

What is Java Synchronized Collections? Complete Tutorials using java.util.Collections

June 2, 2017 Leave a Comment

The post What is Java Synchronized Collections? Complete Tutorials using java.util.Collections appeared first on Crunchify. Author: App Shah Related posts:How to iterate through Java List? Five (5) ways to Iterate Through Loop in Java Implement Simple Threadsafe Cache using HashMap without using Synchronized Collection HashMap Vs. ConcurrentHashMap Vs. SynchronizedMap – How a HashMap can be […]

In Java8 How to Shuffle, Reverse, Copy, Rotate and Swap List using Collection APIs?

May 11, 2017 Leave a Comment 1

Java collection framework is pretty amazing. Collection class consists exclusively of static methods that operate on or return collections. Those operations works on list of different collections like List, Set, etc. In this tutorial we will go over list of Collection Operations which we will perform on List. Let’s get started: We are going to perform […]

In Eclipse How to Fix “This element neither has attached source nor attached Javadoc and hence no Javadoc could be found” issue

May 4, 2017 Leave a Comment

Recently while working on Spring Boot example, after maven import and cleaning project when I was mouse hovering on some of the Spring annotations, there wasn’t any help available I extensively use this feature to understand how framework works and all details about the classes. It is the BEST guided information for me to learn […]

How to Iterate Through Map and List in Java? Example attached (Total 5 Different Ways)

April 22, 2017 Leave a Comment

Do you want to iterate through java.util.Map and java.util.List in Java 8 using latest JDK8? I recently came across the same while working on my production application. Topic looks very simple but it’s worth trying and adopting new ways to iterate through Map and List. Small tips and possible Interview Question you

Java: Producer Consumer Example – Handle Concurrent Read/Write

April 9, 2017 Leave a Comment

The producer-consumer problem (also known as the bounded-buffer problem) is a classic Java Example of a multi-process synchronization problem. The problem describes two processes, the producer and the consumer, who share a common, fixed-size buffer used as a queue. The producer’s job is to generate a piece of data, put it into the buffer and start again. At the same

Java: How to Get Random Key-Value Element From HashMap

April 7, 2017 Leave a Comment

Is there a way to get the value of a HashMap randomly in Java? Of Course, below is a simple Java Code which represents the same. Also, at the end of program there is a bonus code to Shuffle complete HashMap. Reshuffling a large collection is always going to be expensive. You are

How to Access Github Content with Basic OAuth Authentication in Java? HTTPClient Or URLConnection Method

April 5, 2017 Leave a Comment

Sometime back I’ve written an article on How to Read GitHub File Contents using HttpURLConnection. In that tutorial we have created a simple “InputStreamToString” conversion utility which we will use in this tutorial too. Now let’s start with the concept “Basic Authentication”. HTTP Basic authentication implementation is the simplest technique for enforcing access controls

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 7
  • Go to Next Page »

Primary Sidebar

Copyright ©2019 · WPress.Tips - All Rights Are Reserved · Powered by Genesis Framework