public void write(byte[] byteArray,int offset ,int length )throws IOException code example
Example 1: public void write(byte[] byteArray,int offset ,int length )throws IOException
Data written in file...
Example 2: public void write(byte[] byteArray,int offset ,int length )throws IOException
Technicalkeeda
Example 3: public void write(byte[] byteArray,int offset ,int length )throws IOException
package com.technicalkeeda; import java.io.FileOutputStream; public class App { public static void main(String[] args) { try { FileOutputStream fileOutputStream = new FileOutputStream("C:\\technicalkeeda\\hello.txt"); String data = "Hello Technicalkeeda."; byte b[] = data.getBytes(); int offset = 6; int length = 14; fileOutputStream.write(b, offset, length); fileOutputStream.close(); System.out.println("Data written in file..."); } catch (Exception e) { System.out.println(e); } }}