Methods Summary |
---|
public void | writeBE24(int iValue)Writes an unsigned big-endian 24-bit value. (Truncates any higher bits.)
int iOne = iValue & 0xff;
int iTwo = (iValue >> 8) & 0xff;
int iThree = (iValue >> 16) & 0xff;
write(iThree);
write(iTwo);
write(iOne);
|
public void | writeBE32(int iValue)Writes a signed big-endian 32-bit value.
int iOne = iValue & 0xff;
int iTwo = (iValue >> 8) & 0xff;
int iThree = (iValue >> 16) & 0xff;
int iFour = (iValue >> 24) & 0xff;
write(iFour);
write(iThree);
write(iTwo);
write(iOne);
|
public void | writeBEUnsigned16(int iValue)Writes an unsigned big-endian 16-bit value. (Truncates any higher bits.)
int iLo = iValue & 0xff;
int iHi = iValue >> 8;
write(iHi);
write(iLo);
|
public void | writeID3Four(int iValue)Write an encoded four byte value.
The encoding method uses only the lowest seven bits of each byte, to prevent synchronization
errors in the MP3 data stream.
// we're only using the lower seven bits of each byte, so we can't write a value that
// is greater than 28 bits can hold
if (iValue >= (1 << 28))
{
throw new ID3Exception("Cannot write an encoded value greater than 28-bit unsigned.");
}
int iOne = ((iValue >> (3*7)) & 0x7f);
int iTwo = ((iValue >> (2*7)) & 0x7f);
int iThree = ((iValue >> (1*7)) & 0x7f);
int iFour = (iValue & 0x7f);
write(iOne);
write(iTwo);
write(iThree);
write(iFour);
|
public void | writeUnsignedBE32(long lValue)Writes an unsigned big-endian 32-bit value.
int iOne = (int)(lValue & 0xff);
int iTwo = (int)((lValue >> 8) & 0xff);
int iThree = (int)((lValue >> 16) & 0xff);
int iFour = (int)((lValue >> 24) & 0xff);
write(iFour);
write(iThree);
write(iTwo);
write(iOne);
|
public void | writeUnsignedByte(int iValue)Write an unsigned byte value.
writeByte(iValue);
|