পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Wednesday, January 18, 2017

Java.io.DataOutputStream Class

Introduction

The Java.io.DataOutputStream class lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in.

Class declaration

Following is the declaration for Java.io.DataOutputStream class:
public class DataOutputStream
   extends FilterOutputStream
      implements DataOutput

Field

Following are the fields for Java.io.DataOutputStream class:
  • protected int written -- This is the number of bytes written to the data output stream so far.
  • protected OutputStream out -- This is the underlying output stream to be filtered.

Class constructors

S.N. Constructor & Description
1 DataOutputStream(OutputStream out)
This creates a new data output stream to write data to the specified underlying output stream.

Class methods

S.N. Method & Description
1 void flush()
This method flushes this data output stream.
2 int size()
This method returns the current value of the counter written, the number of bytes written to this data output stream so far.
3 void write(byte[] b, int off, int len)
This method writes len bytes from the specified byte array starting at offset off to the underlying output stream.
4 void write(int b)
This method writes the specified byte (the low eight bits of the argument b) to the underlying output stream.
5 void writeBoolean(boolean v)
This method writes a boolean to the underlying output stream as a 1-byte value.
6 void writeByte(int v)
This method writes out a byte to the underlying output stream as a 1-byte value.
7 void writeBytes(String s)
This method writes out the string to the underlying output stream as a sequence of bytes.
8 void writeChar(int v)
This method writes a char to the underlying output stream as a 2-byte value, high byte first.
9 void writeChars(String s)
This method writes a string to the underlying output stream as a sequence of characters.
10 void writeDouble(double v)
This method converts the double argument to a long using the doubleToLongBits method in class Double, and then writes that long value to the underlying output stream as an 8-byte quantity, high byte first.
11 void writeFloat(float v)
This method converts the float argument to an int using the floatToIntBits method in class Float, and then writes that int value to the underlying output stream as a 4-byte quantity, high byte first.
12 void writeInt(int v)
This method writes an int to the underlying output stream as four bytes, high byte first.
13 void writeLong(long v)
This method writes a long to the underlying output stream as eight bytes, high byte first.
14 void writeShort(int v)
This method writes a short to the underlying output stream as two bytes, high byte first.
15 void writeUTF(String str)
This method writes a string to the underlying output stream using modified UTF-8 encoding in a machine-independent manner.

Methods inherited

This class inherits methods from the following classes:
  • Java.io.FilterOutputStream
  • Java.io.Object
  • Java.io.DataOutput

No comments:

Post a Comment