|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecthu.netmind.ogg.Page
public class Page
This class represents a page in the ogg format, and gives low-level manipulator access to all fields. Constitency checks are also implemented to help building a good ogg page.
| Field Summary | |
|---|---|
static FastCrc |
fastCrc
|
static byte[] |
OGG_CAPTURE_PATTERN
|
| Method Summary | |
|---|---|
Packet |
add(Packet packet)
Add a packet to this page. |
boolean |
checkCapturePattern()
Check capture pattern for ogg. |
boolean |
checkCrcChecksum()
Check the crc number in this page. |
long |
computeCrcChecksum()
Compute crc number for this page. |
static Page |
fromByteArray(byte[] b)
Create page from a byte array. |
static Page |
fromByteStream(java.io.InputStream stream)
Convert a serialized page from a byte stream to a page object. |
int |
getBitstreamSerialNumber()
|
byte[] |
getCapturePattern()
|
int |
getCrcChecksum()
|
long |
getGranulePosition()
|
byte |
getHeaderType()
|
int |
getPacketCount()
|
java.util.Collection |
getPackets()
Get all packets in this page. |
int |
getPageSegments()
|
int |
getPageSequenceNumber()
|
byte |
getVersion()
|
boolean |
isBos()
Return whether this a begin of stream page. |
boolean |
isContinued()
Return whether this page's data belong to the previous packet (that packet is continued in this page). |
boolean |
isEos()
Return whether this an end of stream page. |
boolean |
isFull()
Returns whether this page is full, or not. Note:Page is also considered full, if it is a bos page, and one packet is inserted. |
void |
setBitstreamSerialNumber(int bitstreamSerialNumber)
|
void |
setBos()
Set the bos flag. |
void |
setCapturePattern(byte[] capturePattern)
|
void |
setContinued()
Set the continued flag. |
void |
setCrcChecksum(int crcChecksum)
|
void |
setEos()
Set the eos flag. |
void |
setGranulePosition(long granulePosition)
|
void |
setHeaderType(byte headerType)
|
void |
setPageSequenceNumber(int pageSequenceNumber)
|
void |
setVersion(byte version)
|
int |
size()
The size of data residing in this page. |
byte[] |
toByteArray()
Convert this page into a byte array. |
java.lang.String |
toString()
Write human readable representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final byte[] OGG_CAPTURE_PATTERN
public static FastCrc fastCrc
| Method Detail |
|---|
public boolean checkCapturePattern()
public byte[] getCapturePattern()
public void setCapturePattern(byte[] capturePattern)
public byte getVersion()
public void setVersion(byte version)
public boolean isBos()
public boolean isEos()
public void setBos()
public void setEos()
public void setContinued()
public boolean isContinued()
public byte getHeaderType()
public void setHeaderType(byte headerType)
public long getGranulePosition()
public void setGranulePosition(long granulePosition)
public int getBitstreamSerialNumber()
public void setBitstreamSerialNumber(int bitstreamSerialNumber)
public int getPageSequenceNumber()
public void setPageSequenceNumber(int pageSequenceNumber)
public long computeCrcChecksum()
throws java.io.IOException
java.io.IOException - If an error occurs buring converting to byte.
public boolean checkCrcChecksum()
throws java.io.IOException
java.io.IOException - If an error occurs buring converting to byte.public int getCrcChecksum()
public void setCrcChecksum(int crcChecksum)
public int size()
public int getPageSegments()
public boolean isFull()
add() will only return the packet.public java.util.Collection getPackets()
public int getPacketCount()
public Packet add(Packet packet)
public byte[] toByteArray()
throws java.io.IOException
java.io.IOException - If the byte array could not be assembled.
public static Page fromByteArray(byte[] b)
throws java.io.IOException
b - The byte array representing the page.
java.io.IOException - If the byte array operations fail.
public static Page fromByteStream(java.io.InputStream stream)
throws java.io.IOException
checkCrcChecksum() to verify page integrity.
stream - The stream to read.
java.io.IOException - If an I/O error occured.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||