Skip to content

Instantly share code, notes, and snippets.

@jamalsa
Created April 17, 2012 02:37
Show Gist options
  • Save jamalsa/2403038 to your computer and use it in GitHub Desktop.
Save jamalsa/2403038 to your computer and use it in GitHub Desktop.
Menangani message ASCIIHeader
// Mengirim message dengan NBOMinusHeader
int tLength = tRequestStream.length();
String tStrLength = String.format("%04d", tLength); // Padding length jadi 4, misal 100 jadi 0100, 55 jadi 0055
tRequestByteStream.write(tStrLength.getBytes());
tRequestByteStream.write(tRequestStream.getBytes());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment