Kayıtlar

Mart, 2021 tarihine ait yayınlar gösteriliyor

How to parse hex number in [java]

Resim
Hi, We will learn how to parse hex int number parse use bitwise operation let's do it int hexNum = (int) 0xabcd; System.out.println("hexNum binary string " + Integer.toBinaryString(hexNum)); System.out.println("hexNum hex string " + String.format("%02x",hexNum)); // 02 is number of digits // lets get ab System.out.println("hexNum binary string " + Integer.toBinaryString(hexNum&0xFF)); // multiplay by ff System.out.println("hexNum hex string " + String.format("%02x",(hexNum&0xFF))); // 02 is number of digits // lets get cd System.out.println("hexNum binary string " + Integer.toBinaryString((hexNum>>8))); //8 bit shift rigth System.out.println("hexNum hex string " + String.format("%02x",(hexNum>>8))); // 02 is number of digits //8 bit shift rigth

how to comminication Searial port UART in [Java]

https://docs.oracle.com/javame/config/cldc/rel/3.4/core/da/html/device_access/uart.htm#CIHFBAAG 13 UART The com.oracle.deviceaccess.uart package contains interfaces and classes for controlling and reading and writing from/to Universal Asynchronous Receiver/Transmitter (UART), with optional Modem signals control. In order to access and control a specific UART device, an application should first open and obtain an UART instance for the UART device using its numerical ID, name, type (interface) and/or properties. Example 13-1 and Example 13-2 demonstrate how to use the UART APIs to communicate with a host. Example 13-1 Communicating using the UART API import com.oracle.deviceaccess.PeripheralException; import com.oracle.deviceaccess.PeripheralManager; import com.oracle.deviceaccess.uart.UART; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class UARTExample1 { UART host = null; InputStream is = null; OutputStream os = null;...

mulakat sorular

https://levelup.gitconnected.com/56-java-interview-questions-b4f25e3cf9a6 https://levelup.gitconnected.com/56-java-interview-questions-b4f25e3cf9a6 https://levelup.gitconnected.com/56-java-interview-questions-b4f25e3cf9a6 https://levelup.gitconnected.com/56-java-interview-questions-b4f25e3cf9a6 55 Java Interview Questions Marc Fichtel Marc Fichtel Follow Jan 27 · 8 min read For Junior and Intermediate Developers. Answers included! Image for post Photo by Joshua Ness on Unsplash Below you’ll find a list of Java interview questions and answers I’ve gathered during my own job hunts. Before you continue, please note that answers may not be 100% complete, up to date, or optimized, but are in my experience sufficient for interview situations. OOP Questions These questions apply not only to Java, but object oriented languages in general. 1. Compare interfaces and abstract classes Both are used to achieve abstraction. Neither can be instantiated. An abstract class can have concrete i...

How to change File names in a direction [Java]

Refersnce: https://www.geeksforgeeks.org/how-to-rename-all-files-of-a-folder-using-java/ // Java program to illustrate // how to rename Multiple Files // together using single program import java.io.File; import java.io.IOException; public class rename { public static void main(String[] argv) throws IOException { // Path of folder where files are located String folder_path = "C:\\Users\\Anannya Uberoi\\Desktop\\myfolder"; // creating new folder File myfolder = new File(folder_path); File[] file_array = myfolder.listFiles(); for (int i = 0; i
JFoenix java fx lib custo coponent https://github.com/reyoung/JFlowMonitor/tree/master/3rdparty/jNetPcap/example https://github.com/reyoung/JFlowMonitor/blob/master/3rdparty/jNetPcap/example/WinPcapSendQueueTransmitExampleUsingPcapHeader.java https://www.javatips.net/api/diddler-master/src/org/jnetpcap/PcapHeader.java https://www.javatips.net/api/diddler-master/src/org/jnetpcap/winpcap/WinPcapSendQueue.java https://www.geeksforgeeks.org/packet-capturing-using-jnetpcap-in-java/ https://mkyong.com/java/how-to-write-to-file-in-java-bufferedwriter-example/ -- fx custom componentler icin kullaanıslı http://www.jfoenix.com/ https://docs.oracle.com/javase/tutorial/essential/io/file.html https://www.baeldung.com/java-write-to-file https://compscipleslab.wordpress.com/2013/02/17/capturing-network-packets-through-java/ https://www.javatips.net/api/JFlowMonitor-master/3rdparty/jNetPcap/example/WinPcapSendQueueTransmitExampleUsingPcapHeader.java https://pcapdotnet2.rssing.com/chan-72942...

File Operations [java]

referance: http://www.javapractices.com/topic/TopicAction.do?Id=42 FileInputStream fis = new FileInputStream("test.txt"); InputStreamReader in = new InputStreamReader(fis, "UTF-8"); FileOutputStream fos = new FileOutputStream("test.txt"); OutputStreamWriter out = new OutputStreamWriter(fos, "UTF-8"); Scanner scanner = new Scanner(file, "UTF-8"); Example 1 - JDK 7+ import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class ReadWriteTextFileJDK7 { public static void main(String... args) throws IOException{ ReadWriteTextFileJDK7 text = new ReadWriteTextFileJDK7(); //treat as a small file List lines = text.readSmallTextFile(FILE_NAME); ...

How to Copy byte array to another array [java]

byte[] destByteArry = {0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; byte[] srcByteArry = {0x00,0x00}; System.arraycopy(eth,0,byteList,12,2); ----------------- byte[] destByteArry = {0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; byte[] srcByteArry = {0x00,0x00}; System.arraycopy(eth,0,byteList,12,2);