blob: d592a722f7868b96041ebbcbf644136f73fc3ecf [file] [log] [blame]
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.onosproject.xran.codecs.ber.types;
import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
public class BerTimeOfDay extends BerTime {
public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.TIME_OF_DAY_TAG);
private static final long serialVersionUID = 1L;
public BerTimeOfDay() {
}
public BerTimeOfDay(byte[] value) {
super(value);
}
public BerTimeOfDay(String valueAsString) throws UnsupportedEncodingException {
super(valueAsString);
}
@Override
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
int codeLength = super.encode(os, false);
if (withTag) {
codeLength += tag.encode(os);
}
return codeLength;
}
@Override
public int decode(InputStream is, boolean withTag) throws IOException {
int codeLength = 0;
if (withTag) {
codeLength += tag.decodeAndCheck(is);
}
codeLength += super.decode(is, false);
return codeLength;
}
}