@Test public void testToString16() { CcsdsPacket ccsdsPacket = new CcsdsPacket(ByteBuffer.wrap(testPacketOf32Bytes)); TimeEncoding.setUp(); String packetString = ccsdsPacket.toString(); Assert.assertEquals("apid: 906\n" + "packetId: 318825003\n" + "0000: 1b8a e154 005b 467f b356 7245 1300 e22b ...T.[F\u007F.VrE...+\n" + "0010: a192 0300 0026 0001 0090 0030 07e1 0133 .....&.....0...3\n\n", packetString); }
@Override public String toString() { StringBuffer sb = new StringBuffer(); StringBuffer text = new StringBuffer(); byte c; int len = bb.limit(); int lengthRoundedUpToNextMultipleOf16 = (int) Math.ceil(len / 16.0) * 16; sb.append("apid: " + getAPID() + "\n"); sb.append("packetId: " + getPacketID() + "\n"); for (int i = 0; i < lengthRoundedUpToNextMultipleOf16; ++i) { if (i % 16 == 0) { sb.append(String.format("%04x:", i)); text.setLength(0); } if ((i & 1) == 0) { sb.append(" "); } if (i < len) { c = bb.get(i); sb.append(String.format("%02x", 0xFF & c)); text.append(((c >= ' ') && (c <= 127)) ? String.format("%c", c) : "."); } else { sb.append(" "); text.append(" "); } if ((i + 1) % 16 == 0) { sb.append(" "); sb.append(text); sb.append("\n"); } } sb.append("\n"); return sb.toString(); }
CcsdsPacket { @Override public String toString() { StringBuffer sb = new StringBuffer(); StringBuffer text = new StringBuffer(); byte c; int len = bb.limit(); int lengthRoundedUpToNextMultipleOf16 = (int) Math.ceil(len / 16.0) * 16; sb.append("apid: " + getAPID() + "\n"); sb.append("packetId: " + getPacketID() + "\n"); for (int i = 0; i < lengthRoundedUpToNextMultipleOf16; ++i) { if (i % 16 == 0) { sb.append(String.format("%04x:", i)); text.setLength(0); } if ((i & 1) == 0) { sb.append(" "); } if (i < len) { c = bb.get(i); sb.append(String.format("%02x", 0xFF & c)); text.append(((c >= ' ') && (c <= 127)) ? String.format("%c", c) : "."); } else { sb.append(" "); text.append(" "); } if ((i + 1) % 16 == 0) { sb.append(" "); sb.append(text); sb.append("\n"); } } sb.append("\n"); return sb.toString(); } }
CcsdsPacket { @Override public String toString() { StringBuffer sb = new StringBuffer(); StringBuffer text = new StringBuffer(); byte c; int len = bb.limit(); int lengthRoundedUpToNextMultipleOf16 = (int) Math.ceil(len / 16.0) * 16; sb.append("apid: " + getAPID() + "\n"); sb.append("packetId: " + getPacketID() + "\n"); for (int i = 0; i < lengthRoundedUpToNextMultipleOf16; ++i) { if (i % 16 == 0) { sb.append(String.format("%04x:", i)); text.setLength(0); } if ((i & 1) == 0) { sb.append(" "); } if (i < len) { c = bb.get(i); sb.append(String.format("%02x", 0xFF & c)); text.append(((c >= ' ') && (c <= 127)) ? String.format("%c", c) : "."); } else { sb.append(" "); text.append(" "); } if ((i + 1) % 16 == 0) { sb.append(" "); sb.append(text); sb.append("\n"); } } sb.append("\n"); return sb.toString(); } CcsdsPacket(byte[] packet);  CcsdsPacket(ByteBuffer bb); }
CcsdsPacket { @Override public String toString() { StringBuffer sb = new StringBuffer(); StringBuffer text = new StringBuffer(); byte c; int len = bb.limit(); int lengthRoundedUpToNextMultipleOf16 = (int) Math.ceil(len / 16.0) * 16; sb.append("apid: " + getAPID() + "\n"); sb.append("packetId: " + getPacketID() + "\n"); for (int i = 0; i < lengthRoundedUpToNextMultipleOf16; ++i) { if (i % 16 == 0) { sb.append(String.format("%04x:", i)); text.setLength(0); } if ((i & 1) == 0) { sb.append(" "); } if (i < len) { c = bb.get(i); sb.append(String.format("%02x", 0xFF & c)); text.append(((c >= ' ') && (c <= 127)) ? String.format("%c", c) : "."); } else { sb.append(" "); text.append(" "); } if ((i + 1) % 16 == 0) { sb.append(" "); sb.append(text); sb.append("\n"); } } sb.append("\n"); return sb.toString(); } CcsdsPacket(byte[] packet);  CcsdsPacket(ByteBuffer bb); int getSecondaryHeaderFlag(); static boolean getSecondaryHeaderFlag(byte[] packet); int getSequenceCount(); static int getSequenceCount(byte[] packet); void setSequenceCount(short seqCount); static short getSequenceCount(ByteBuffer bb); int getAPID(); void setAPID(int apid); static short getAPID(ByteBuffer bb); static int getCccsdsPacketLength(ByteBuffer bb); int getCccsdsPacketLength(); void setCccsdsPacketLength(short length); int getLength(); long getCoarseTime(); int getTimeId(); void setCoarseTime(int time); static long getCoarseTime(ByteBuffer bb); int getFineTime(); void setFineTime(short fineTime); static int getFineTime(ByteBuffer bb); boolean getChecksumIndicator(); static boolean getChecksumIndicator(byte[] packet); int getPacketID(); void setPacketID(int id); byte[] getBytes(); ByteBuffer getByteBuffer(); int getPrivateHeaderClass(); int getPrivateHeaderType(); int getPrivateHeaderSource(); void fillCheckword(); static CcsdsPacket getPacketFromStream(InputStream input); static short getAPID(byte[] packet); static int getCccsdsPacketLength(byte[] buf); @Override String toString(); }
CcsdsPacket { @Override public String toString() { StringBuffer sb = new StringBuffer(); StringBuffer text = new StringBuffer(); byte c; int len = bb.limit(); int lengthRoundedUpToNextMultipleOf16 = (int) Math.ceil(len / 16.0) * 16; sb.append("apid: " + getAPID() + "\n"); sb.append("packetId: " + getPacketID() + "\n"); for (int i = 0; i < lengthRoundedUpToNextMultipleOf16; ++i) { if (i % 16 == 0) { sb.append(String.format("%04x:", i)); text.setLength(0); } if ((i & 1) == 0) { sb.append(" "); } if (i < len) { c = bb.get(i); sb.append(String.format("%02x", 0xFF & c)); text.append(((c >= ' ') && (c <= 127)) ? String.format("%c", c) : "."); } else { sb.append(" "); text.append(" "); } if ((i + 1) % 16 == 0) { sb.append(" "); sb.append(text); sb.append("\n"); } } sb.append("\n"); return sb.toString(); } CcsdsPacket(byte[] packet);  CcsdsPacket(ByteBuffer bb); int getSecondaryHeaderFlag(); static boolean getSecondaryHeaderFlag(byte[] packet); int getSequenceCount(); static int getSequenceCount(byte[] packet); void setSequenceCount(short seqCount); static short getSequenceCount(ByteBuffer bb); int getAPID(); void setAPID(int apid); static short getAPID(ByteBuffer bb); static int getCccsdsPacketLength(ByteBuffer bb); int getCccsdsPacketLength(); void setCccsdsPacketLength(short length); int getLength(); long getCoarseTime(); int getTimeId(); void setCoarseTime(int time); static long getCoarseTime(ByteBuffer bb); int getFineTime(); void setFineTime(short fineTime); static int getFineTime(ByteBuffer bb); boolean getChecksumIndicator(); static boolean getChecksumIndicator(byte[] packet); int getPacketID(); void setPacketID(int id); byte[] getBytes(); ByteBuffer getByteBuffer(); int getPrivateHeaderClass(); int getPrivateHeaderType(); int getPrivateHeaderSource(); void fillCheckword(); static CcsdsPacket getPacketFromStream(InputStream input); static short getAPID(byte[] packet); static int getCccsdsPacketLength(byte[] buf); @Override String toString(); static final int MAX_CCSDS_SIZE; }