Exemple #1
0
  public byte[] getRawContent() throws UnsupportedEncodingException {
    byte[] idBytes = getBytes(getId(), "ISO-8859-1");
    byte[] contentBytes = getBytes(content, getEncoding());
    byte[] buf = new byte[4 + 4 + idBytes.length + 1 + contentBytes.length];
    byte[] flags = {0x00, 0x00, 0x00, 0x00};

    int offset = 0;
    Utils.copy(getSize(contentBytes.length), buf, offset);
    offset += 4;
    Utils.copy(flags, buf, offset);
    offset += 4;
    Utils.copy(idBytes, buf, offset);
    offset += idBytes.length;
    buf[offset] = 0;
    offset += 1;
    Utils.copy(contentBytes, buf, offset);
    offset += contentBytes.length;

    return buf;
  }
Exemple #2
0
 public int getSamplingRate() {
   return Utils.getNumber(b, 20, 23);
 }
Exemple #3
0
 public int getBitsPerSample() {
   return Utils.getNumber(b, 16, 17);
 }
Exemple #4
0
 public int getChannelNumber() {
   return Utils.getNumber(b, 18, 19);
 }
Exemple #5
0
 public long getTotalFrames() {
   return Utils.getLongNumber(b, 12, 15);
 }
Exemple #6
0
 public long getFinalFrameBlocks() {
   return Utils.getLongNumber(b, 8, 11);
 }
Exemple #7
0
 public long getBlocksPerFrame() {
   return Utils.getLongNumber(b, 4, 7);
 }
Exemple #8
0
 public int getFormatFlags() {
   return Utils.getNumber(b, 2, 3);
 }
Exemple #9
0
 public int getCompressionLevel() {
   return Utils.getNumber(b, 0, 1);
 }