The Artima Developer Community
Sponsored Link

Java Buzz Forum
ReadableResource: A common interface for files, URLs, byte arrays, and other readable resources.

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Mike Kaufman

Posts: 125
Nickname: mkaufman
Registered: Jan, 2007

Mike Kaufman started programming in 1973 and is still here.
ReadableResource: A common interface for files, URLs, byte arrays, and other readable resources. Posted: Apr 2, 2007 8:09 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Mike Kaufman.
Original Post: ReadableResource: A common interface for files, URLs, byte arrays, and other readable resources.
Feed Title: Closing Braces
Feed URL: https://closingbraces.net/feed/
Feed Description: After-hours notes and opinions on Java and system development.
Latest Java Buzz Posts
Latest Java Buzz Posts by Mike Kaufman
Latest Posts From Closing Braces

Advertisement
InputStream provides a general mechanism for accessing a resource regardless of the nature of the resource, but isn't convenient for passing to methods or storing within objects. In contrast, specific types of resources have representations that can conveniently be passed around and stored (e.g. File, URL, byte[]) but commit the code to one specific type of resource. One way to get the best of both worlds is to define a "ReadableResource" interface to represent any resource from which an InputStream can be obtained, together with suitable implementation classes for each type of resource. The same approach is also applicable for writable resources and their OutputStreams.

Read: ReadableResource: A common interface for files, URLs, byte arrays, and other readable resources.

Topic: Base64 - Something Sun Should Have Included Long Ago Previous Topic   Next Topic Topic: JDK 1.5 Array Puzzler

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use