Java Doc for SourceStream.java in  » 6.0-JDK-Modules » j2me » javax » microedition » media » protocol » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » javax.microedition.media.protocol 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.microedition.media.protocol.SourceStream

SourceStream
public interface SourceStream extends Controllable(Code)
Abstracts a single stream of media data. It is used in conjunction with DataSource to provide the input interface to a Player

SourceStream may provide type-specific controls. For that reason, it implements the Controllable interface to provide additional controls.
See Also:   DataSource



Field Summary
 intNOT_SEEKABLE
     The value returned by getSeekType indicating that this SourceStream is not seekable.
 intRANDOM_ACCESSIBLE
     The value returned by getSeekType indicating that this SourceStream can be seeked anywhere within the media.
 intSEEKABLE_TO_START
     The value returned by getSeekType indicating that this SourceStream can be seeked only to the beginning of the media stream.


Method Summary
 ContentDescriptorgetContentDescriptor()
     Get the content type for this stream.
 longgetContentLength()
     Get the size in bytes of the content on this stream. The content length in bytes.
 intgetSeekType()
     Find out if the stream is seekable. The return value can be one of these three: NOT_SEEKABLE, SEEKABLE_TO_START and RANDOM_ACCESSIBLE. If the return value is SEEKABLE_TO_START, it means that the stream can only be repositioned to the beginning of the stream.
 intgetTransferSize()
     Get the size of a "logical" chunk of media data from the source. This method can be used to determine the minimum size of the buffer to use in conjunction with the read method to read data from the source. The minimum size of the buffer needed to read a "logical"chunk of data from the source.
 intread(byte[] b, int off, int len)
     Reads up to len bytes of data from the input stream into an array of bytes.
 longseek(long where)
     Seek to the specified point in the stream.
 longtell()
     Obtain the current position in the stream.

Field Detail
NOT_SEEKABLE
int NOT_SEEKABLE(Code)
The value returned by getSeekType indicating that this SourceStream is not seekable.

Value 0 is assigned to NOT_SEEKABLE.




RANDOM_ACCESSIBLE
int RANDOM_ACCESSIBLE(Code)
The value returned by getSeekType indicating that this SourceStream can be seeked anywhere within the media.

Value 2 is assigned to RANDOM_ACCESSIBLE.




SEEKABLE_TO_START
int SEEKABLE_TO_START(Code)
The value returned by getSeekType indicating that this SourceStream can be seeked only to the beginning of the media stream.

Value 1 is assigned to SEEKABLE_TO_START.






Method Detail
getContentDescriptor
ContentDescriptor getContentDescriptor()(Code)
Get the content type for this stream. The current ContentDescriptor for this stream.



getContentLength
long getContentLength()(Code)
Get the size in bytes of the content on this stream. The content length in bytes. -1 is returned if the length is not known.



getSeekType
int getSeekType()(Code)
Find out if the stream is seekable. The return value can be one of these three: NOT_SEEKABLE, SEEKABLE_TO_START and RANDOM_ACCESSIBLE. If the return value is SEEKABLE_TO_START, it means that the stream can only be repositioned to the beginning of the stream. If the return value is RANDOM_ACCESSIBLE, the stream can be seeked anywhere within the stream. Returns an enumerated value to indicate the level of seekability.



getTransferSize
int getTransferSize()(Code)
Get the size of a "logical" chunk of media data from the source. This method can be used to determine the minimum size of the buffer to use in conjunction with the read method to read data from the source. The minimum size of the buffer needed to read a "logical"chunk of data from the source. Returns -1 if the size cannot bedetermined.
See Also:   SourceStream.read(byte[],int,int)



read
int read(byte[] b, int off, int len) throws IOException(Code)
Reads up to len bytes of data from the input stream into an array of bytes. An attempt is made to read as many as len bytes, but a smaller number may be read. The number of bytes actually read is returned as an integer.

This method blocks until input data is available, end of file is detected, or an exception is thrown.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one byte. If no byte is available because the stream is at end of file, the value -1 is returned; otherwise, at least one byte is read and stored into b.

The first byte read is stored into element b[off], the next one into b[off+1], and so on. The number of bytes read is, at most, equal to len. Let k be the number of bytes actually read; these bytes will be stored in elements b[off] through b[off+k-1], leaving elements b[off+k] through b[off+len-1] unaffected.

If the first byte cannot be read for any reason other than end of file, then an IOException is thrown. In particular, an IOException is thrown if the input stream has been closed.
Parameters:
  b - the buffer into which the data is read.
Parameters:
  off - the start offset in array bat which the data is written.
Parameters:
  len - the maximum number of bytes to read. the total number of bytes read into the buffer, or-1 if there is no more data because the end ofthe stream has been reached.
exception:
  IOException - if an I/O error occurs.




seek
long seek(long where) throws IOException(Code)
Seek to the specified point in the stream. The seek method may, for a variety of reasons, fail to seek to the specified position. For example, it may be asked to seek to a position beyond the size of the stream; or the stream may only be seekable to the beginning (getSeekType returns SEEKABLE_TO_START). The return value indicates whether the seeking is successful. If it is successful, the value returned will be the same as the given position. Otherwise, the return value will indicate what the new position is.

If the given position is negative, seek will treat that as 0 and attempt to seek to 0.

An IOException will be thrown if an I/O error occurs, e.g. when the stream comes from a remote connection and the connection is broken.
Parameters:
  where - The position to seek to. The new stream position.
exception:
  IOException - Thrown if an I/O error occurs.




tell
long tell()(Code)
Obtain the current position in the stream. The current position in the stream.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.