The method *getBytesFromFile* is not a static method in *java.io.File*
It is a static method in *com.compoze.util.IoUtility*

On Friday, September 11, 2015 at 12:44:20 PM UTC-4, JediDroid wrote:
>
> I am using Android Studio and Oracle Java 8. I am trying to get all bytes 
> from a file and pass them to a byte array.
>
>
> It is my understanding based on the Oracle website, that the method 
> getBytesFromFile() is defined in the Java library import java.io.File.
>
> See: 
> https://docs.oracle.com/cd/E13218_01/wlp/compozearchive/javadoc/portlets25/com/compoze/util/IoUtility.html#getBytesFromFile(java.io.File)
>
>
> I should be able to call the method in my code. 
>
>
> But I get the error message:
>
> cannot resolve method 'getBytesFromFile(java.io.File)'
>
>
> Why do I get the error message?
>
>
> It looks like it does not see import java.io.File.
>
>
>
> import java.io.File;
>
>
> // Read the recording.pcm file from storage.FileInputStream recordingFile = 
> openFileInput(recording.pcm, Context.MODE_WORLD_READABLE);
> recordingFile.read(string.getBytes());
> recordingFile.close();
> // NOTE: The code below gives error message: cannot resolve method 
> 'getBytesFromFile(java.io.File)'byte[] data = getBytesFromFile(recordingFile);
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to