Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

what is the difference between Byte and Stream?6

 
Ranch Hand
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the difference between Byte and Stream?
 
Ranch Hand
Posts: 449
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jacob deiter wrote:what is the difference between Byte and Stream?


In Java, there are APIs for reading and writing streams of data. The type of data can vary from Characters to Bytes to any type.

InputStream is the superclass of all classes representing an input stream of bytes. Applications that need to define a subclass of InputStream must always provide a method that returns the next byte of input. Similarly, OutputStream is the superclass of all classes representing an output stream of bytes.

Also see Java Tutorial
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The difference between Byte and Stream - what do you mean? Those two are two totally different things. It's like asking "What's the difference between a cup of coffee and a bicycle?".

Can you explain why you are asking this quesion, in what way are you not clear about the difference between Byte and Stream?

Byte is a wrapper class for the primitive type byte (see the API documentation of java.lang.Byte). There's no class or interface called Stream in the standard Java API. There are InputStream and OutputStream, in the package java.io. Streams are 'channels' to transport data from one place to another, for example from a file on disk to memory or vice versa.
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic