Java.io.OutputStream class in Java

This abstract class is the superclass of all classes representing an output stream of bytes. An output stream accepts output bytes and sends them to some sink. Applications that need to define a subclass of OutputStream must always provide at least a method that writes one byte of output. Constructor and Description OutputStream() : Single… Read More »

Java.io.BufferedOutputStream class in Java

Java.io.BufferedInputStream class in Java Java.io.BufferedOutputStream class implements a buffered output stream. By setting up such an output stream, an application can write bytes to the underlying output stream without necessarily causing a call to the underlying system for each byte written. Fields protected byte[] buf: The internal buffer where data is stored. protected int count:… Read More »

Java.io.Printstream Class in Java | Set 1

A PrintStream adds functionality to another output stream, namely the ability to print representations of various data values conveniently. Unlike other output streams, a PrintStream never throws an IOException; instead, exceptional situations merely set an internal flag that can be tested via the checkError method. Optionally, a PrintStream can be created so as to flush… Read More »

Java.io.PrintWriter class in Java | Set 2

Java.io.PrintWriter class in Java | Set 1 More methods: PrintWriter printf(Locale l, String format, Object… args) : A convenience method to write a formatted string to this writer using the specified format string and arguments. Syntax :public PrintWriter printf(Locale l, String format, Object… args) Parameters: l – The locale to apply during formatting. If l… Read More »

Java.io.PrintWriter class in Java | Set 1

This class gives Prints formatted representations of objects to a text-output stream. It implements all of the print methods found in PrintStream. It does not contain methods for writing raw bytes, for which a program should use unencoded byte streams. Unlike the PrintStream class, if automatic flushing is enabled it will be done only when… Read More »

Twitter Sentiment Analysis using Python

This article covers the sentiment analysis of any topic by parsing the tweets fetched from Twitter using Python. What is sentiment analysis? Sentiment Analysis is the process of ‘computationally’ determining whether a piece of writing is positive, negative or neutral. It’s also known as opinion mining, deriving the opinion or attitude of a speaker. Why… Read More »

Queries on subsequence of string

Given a string S and Q queries, each query contains a string T. The task is print “Yes” if T is subsequence of S, else print “No”. Examples: Input : S = “geeksforgeeks” Query 1: “gg” Query 2: “gro” Query 3: “gfg” Query 4: “orf” Output : Yes No Yes No For each query, using… Read More »

Java.io.FileDescriptor in Java

java.io.FileDescriptor works for opening a file having a specific name. If there is any content present in that file it will first erase all that content and put “Beginning of Process” as the first line. Instances of the file descriptor class serve as an opaque handle to the underlying machine-specific structure representing an open file,… Read More »

reduce() in Python

The reduce(fun,seq) function is used to apply a particular function passed in its argument to all of the list elements mentioned in the sequence passed along.This function is defined in “functools” module. Working :  At first step, first two elements of sequence are picked and the result is obtained. Next step is to apply the… Read More »