IDeviceConnection

public interface IDeviceConnection

com.android.incfs.install.IDeviceConnection


읽고 쓸 수 있는 기기와의 연결을 나타냅니다.

요약

중첩된 클래스

interface IDeviceConnection.Factory

 

공개 메서드

abstract int read(ByteBuffer buffer, long timeOutMs)

이 연결에서 지정된 버퍼로 바이트 시퀀스를 읽습니다.

abstract int write(ByteBuffer buffer, long timeOutMs)

지정된 버퍼에서 기기로 바이트 시퀀스를 씁니다.

공개 메서드

읽기

public abstract int read (ByteBuffer buffer, 
                long timeOutMs)

이 연결에서 지정된 버퍼로 바이트 시퀀스를 읽습니다.

이 메서드가 호출되는 순간 버퍼에 남아 있는 바이트 수(즉, dst.remaining())인 r 바이트까지 기기를 읽으려고 시도합니다.

매개변수
buffer ByteBuffer: 소켓에서 읽은 데이터를 저장할 위치

timeOutMs long: 제한 시간(밀리초)(전체 작업 완료)

반환 값
int 읽은 바이트 수입니다(0일 수 있음). 명령어가 종료된 경우 -1입니다.

도와줘

public abstract int write (ByteBuffer buffer, 
                long timeOutMs)

지정된 버퍼에서 기기로 바이트 시퀀스를 씁니다.

이 메서드가 호출되는 시점에 버퍼에 남아 있는 바이트 수(즉, src.remaining())인 r 바이트까지 기기에 쓰려고 시도합니다. CAN NOT TRANSLATE

매개변수
buffer ByteBuffer: 전송할 데이터

timeOutMs long: 제한 시간(밀리초)(전체 작업 완료)

반환 값
int 작성된 바이트 수입니다(0일 수 있음). 명령어가 종료된 경우 -1입니다.