Java Code Example for BufferedInputStream : mark() method

BufferedInputStream mark() method marks the current position in this input stream. A subsequent call to the reset method repositions this stream at the last marked position so that subsequent reads re-read the same bytes. The readlimit argument tells this input stream to allow that many bytes to be read before the mark position gets invalidated. …

Read More

Java Code for BufferedInputStream : reset() Method Example

BufferedInputStream reset() method repositions the current stream to the position at the time the mark method was called last time on this input stream. If markpos is -1 (no mark has been set or the mark has been invalidated), an IOException is thrown. Otherwise, pos is set equal to markpos. Overrides: reset in class FilterInputStream …

Read More

Compile Scala Program using Ant Library

http://jakarta.apache.org/ant/. Ant allows the developer to automate the repeated process involved in the development of Java/Scala application. Developers can easily write the script to automate the build process like compilation, archiving and deployment.  

Read More

Java Code Example for BufferedInputStream: skip() method

skip() method of BufferedInputStream class creates a byte array and then repeatedly reads into it until n bytes have been read or the end of the stream has been reached. Skips over and discards n bytes of data from this input stream. The skip method may, for a variety of reasons, end up skipping over …

Read More

Java Code Example for BufferedInputStream: close() method

close() method of BufferedInputStream closes the current input stream and releases any system resources associated with the stream. Once the stream has been closed, further read(), available(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.

Read More

Java Code Example for BufferedInputStream: read(byte[] b,int off,int len) Method

Reads bytes from this byte-input stream into the specified byte array, starting at the given offset. It attempts to read as many bytes as possible by repeatedly invoking the read method of the underlying stream. This iterated read continues until one of the following conditions becomes true: The specified number of bytes have been read, …

Read More

Java Code Example for BufferedInputStream: read() Method

read() method of BufferedInputStream class reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the …

Read More

Java Code Example for BufferedInputStream to read file

BufferedInputStream adds an additionally capability to InputStream by buffering the input. When instance of BufferedInputStream is created, an internal array is created to buffer the input data. As bytes from stream are read or skipped, the internal buffer is refilled as necessary from the contained input stream, many bytes at a time. BufferedInputStream class has …

Read More

Code Example for BufferedInputStream: available() method

BufferedInputStream available() method returns the total count of bytes that can be read or skipped over from the input stream without blocking by next invocation of a method for the input stream. The next invocation might be the same thread or another thread. A single read or skip of this many bytes will not block, …

Read More

Scala Specs now Superseded by Scala Specs2

The Owner of SPECS project commented on my previous post Development Tools available for Scala Language saying that new version of Specs2 is available. Let me briefly drive you in this. SPECS is the Behavior Driven Design Framework which works as an alternative for Junit when specifying or testing Scala projects. Now the SPEC project …

Read More

Difference between Scala val and var

In Scala Language you can define a variable using either a val or a var keyword. The variables defined using val keyword are immutable and can’t be changed after initialization. And the variable defined using var keyword are mutable and can be changed any number of times until it is present in the scope. The immutability applies …

Read More

Scala Code For Reading File

There are many ways reading file in using Scala language. I will walk-through the options available for reading the file. If anyone wants to add improvements in below code example please feel to add it in the comment. This Scala code is tested on large file and it works fine. /** * Scala code to read the …

Read More

Business Intelligence and Reporting Tool – BIRT

Abstract Reports are the key feature of most of the business applications. We design reports to display the result of an investigation or enquiry. Business applications contains variety of report requirements such as data reports, charts, images, custom objects etc. Thus to accumulate all these requirements we require a specialized reporting tool that will support …

Read More

Infinispan – A Open Source Datagrid Platform

Infinispan is a highly popular new data grid platform that is taking the world by storm. In this session, Infinispan founder and project lead Manik Surtani will talk about some of the most interesting, massive scale uses of Infinispan they have witnessed within the community, and will talk about lessons learned from them. They will …

Read More

Your First Application in Scala – Video Tutorial

Scala is a hybrid functional and object-oriented language. When creating a multithreaded application in Scala, you’ll lean toward a functional style of programming where you write lock-free code with immutable state. Scala provides an actor-based message-passing model that removes the pain associated with concurrency. Using this model, you can write concise multithreaded code without the …

Read More

Scala Traits and Java Interfaces – Video Tutorial

This video clip explains what happens when we develop a trait (that includes both abstract and concrete methods) in Scala and compile it. The outcome is an interface in Java together with a class. For each one of the concrete methods the traits includes we will find a static method within that class. We can …

Read More

Development Tools available for Scala Language

Due increased popularity of scala language and increase number of user in scala world new development tools for Scala language are evolving now a days. I thought i should gather the list  of  Scala development tools available. Please feel free to add the Scala tools if i have missed any. SIMPLE BUILD TOOL FOR SCALA …

Read More

Aspect-Oriented Modeling – Google Tech Talk (Video)

In software engineering, aspects are concerns that cut across multiple modules. They can lead to the common problems of concern tangling and scattering: concern tangling is where software concerns are not represented independently of each other; concern scattering is where a software concern is represented in multiple remote places in a software artifact. Although aspect-oriented …

Read More

Scala – A Scalable Language (Video Tutorial)

Creator of Scala language has explained in a very nice way. In this talk he describes the design principles of the Scala programming language, which has scalability as its primary design objective. Today’s software landscape resembles increasingly a tower of Babel: Systems are built using many different languages, combining server-side and client-side languages, scripting and …

Read More

How to insert XMLType column value in oracle10g using JDBC driver?

Recently while working on the client project, i can came across a situation where i have to insert the XML file as XMLType datatype in Oracle 10g table. I was trying to insert the XML file as CLOB object, but it was giving me some Exception. I tried below options for this Inserting the XML …

Read More