MCPcopy Create free account
hub / github.com/Gagravarr/VorbisJava / getHeader

Method getHeader

core/src/main/java/org/gagravarr/ogg/OggPage.java:276–307  ·  view source on GitHub ↗

Gets the header, but with a blank CRC field

()

Source from the content-addressed store, hash-verified

274 * Gets the header, but with a blank CRC field
275 */
276 protected byte[] getHeader() {
277 byte[] header = new byte[MINIMUM_PAGE_SIZE + numLVs];
278 header[0] = (byte)'O';
279 header[1] = (byte)'g';
280 header[2] = (byte)'g';
281 header[3] = (byte)'S';
282
283 header[4] = 0; // Version
284
285 byte flags = 0;
286 if(isContinue) {
287 flags += 1;
288 }
289 if(isBOS) {
290 flags += 2;
291 }
292 if(isEOS) {
293 flags += 4;
294 }
295 header[5] = flags;
296
297 IOUtils.putInt8(header, 6, granulePosition);
298 IOUtils.putInt4(header, 14, sid);
299 IOUtils.putInt4(header, 18, seqNum);
300
301 // Checksum @ 22 left blank for now
302
303 header[26] = IOUtils.fromInt(numLVs);
304 System.arraycopy(lvs, 0, header, MINIMUM_PAGE_SIZE, numLVs);
305
306 return header;
307 }
308
309
310 public String toString() {

Callers 4

testCRCMethod · 0.95
testCRCProblemMethod · 0.95
isChecksumValidMethod · 0.95
writeHeaderMethod · 0.95

Calls 3

putInt8Method · 0.95
putInt4Method · 0.95
fromIntMethod · 0.95

Tested by 2

testCRCMethod · 0.76
testCRCProblemMethod · 0.76