1/* 2* Copyright (C) 2015 Samsung System LSI 3* Licensed under the Apache License, Version 2.0 (the "License"); 4* you may not use this file except in compliance with the License. 5* You may obtain a copy of the License at 6* 7* http://www.apache.org/licenses/LICENSE-2.0 8* 9* Unless required by applicable law or agreed to in writing, software 10* distributed under the License is distributed on an "AS IS" BASIS, 11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12* See the License for the specific language governing permissions and 13* limitations under the License. 14*/ 15 16package android.bluetooth; 17 18import android.os.Parcel; 19import android.os.Parcelable; 20 21import java.util.Arrays; 22 23/** @hide */ 24public class SdpRecord implements Parcelable { 25 26 private final byte[] mRawData; 27 private final int mRawSize; 28 29 @Override 30 public String toString() { 31 return "BluetoothSdpRecord [rawData=" + Arrays.toString(mRawData) 32 + ", rawSize=" + mRawSize + "]"; 33 } 34 35 public SdpRecord(int sizeRecord, byte[] record) { 36 mRawData = record; 37 mRawSize = sizeRecord; 38 } 39 40 public SdpRecord(Parcel in) { 41 mRawSize = in.readInt(); 42 mRawData = new byte[mRawSize]; 43 in.readByteArray(mRawData); 44 45 } 46 47 @Override 48 public int describeContents() { 49 return 0; 50 } 51 52 @Override 53 public void writeToParcel(Parcel dest, int flags) { 54 dest.writeInt(mRawSize); 55 dest.writeByteArray(mRawData); 56 57 58 } 59 60 public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { 61 public SdpRecord createFromParcel(Parcel in) { 62 return new SdpRecord(in); 63 } 64 65 public SdpRecord[] newArray(int size) { 66 return new SdpRecord[size]; 67 } 68 }; 69 70 public byte[] getRawData() { 71 return mRawData; 72 } 73 74 public int getRawSize() { 75 return mRawSize; 76 } 77} 78